update channel log messages
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 39s
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 39s
This commit is contained in:
parent
a3ffaf1ab9
commit
38bde93d16
@ -31,10 +31,9 @@ public class ChannelListener implements EventListener {
|
||||
@Override
|
||||
public void onChannelCreate(@NonNull BatGuild guild, @NonNull ChannelCreateEvent event) {
|
||||
logFeature.sendLog(guild, LogType.CHANNEL_CREATE, EmbedUtils.successEmbed()
|
||||
.setDescription(new EmbedDescriptionBuilder("Channel Created")
|
||||
.setDescription(new EmbedDescriptionBuilder("%s Channel Created".formatted(EnumUtils.getEnumName(event.getChannel().getType())))
|
||||
.appendLine("Channel: %s".formatted(event.getChannel().getAsMention()), true)
|
||||
.appendLine("Name: %s".formatted(event.getChannel().getName()), true)
|
||||
.appendLine("Type: %s".formatted(EnumUtils.getEnumName(event.getChannel().getType())), true)
|
||||
.build())
|
||||
.build());
|
||||
}
|
||||
@ -42,14 +41,13 @@ public class ChannelListener implements EventListener {
|
||||
@Override
|
||||
public void onChannelDelete(@NonNull BatGuild guild, @NonNull ChannelDeleteEvent event) {
|
||||
ChannelUnion channel = event.getChannel();
|
||||
EmbedDescriptionBuilder description = new EmbedDescriptionBuilder("Channel Deleted")
|
||||
EmbedDescriptionBuilder description = new EmbedDescriptionBuilder("%s Channel Deleted".formatted(EnumUtils.getEnumName(channel.getType())))
|
||||
.appendLine("Channel: %s".formatted(channel.getAsMention()), true)
|
||||
.appendLine("Name: %s".formatted(channel.getName()), true);
|
||||
if (channel.getType().isMessage()) {
|
||||
TextChannel textChannel = channel.asTextChannel();
|
||||
description.appendLine("Topic: %s".formatted(textChannel.getTopic()), true);
|
||||
}
|
||||
description.appendLine("Type: %s".formatted(EnumUtils.getEnumName(channel.getType())), true);
|
||||
logFeature.sendLog(guild, LogType.CHANNEL_DELETE, EmbedUtils.errorEmbed().setDescription(description.build()).build());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user