forked from Fascinated/Bat
fix channel rename log
This commit is contained in:
@ -96,11 +96,14 @@ public class ChannelListener implements EventListener {
|
||||
ChannelUnion channel = event.getChannel();
|
||||
String type = formatChannelType(channel);
|
||||
log.info("{} \"{}\" name was updated to {} in guild \"{}\"", type, event.getNewValue(), event.getOldValue(), guild.getName());
|
||||
EmbedDescriptionBuilder description = new EmbedDescriptionBuilder("%s Name Updated".formatted(type));
|
||||
if (channel.getType() == ChannelType.TEXT || channel.getType() == ChannelType.VOICE) {
|
||||
description.appendLine("Channel: %s".formatted(event.getChannel().getAsMention()), true);
|
||||
}
|
||||
description.appendLine("Old Name: `%s`".formatted(event.getOldValue()), true);
|
||||
description.appendLine("New Name: `%s`".formatted(event.getNewValue()), true);
|
||||
logFeature.sendLog(guild, LogType.CHANNEL_UPDATE_NAME, EmbedUtils.successEmbed()
|
||||
.setDescription(new EmbedDescriptionBuilder("%s Name Updated".formatted(type))
|
||||
.appendLine("%s: %s".formatted(type, event.getChannel().getAsMention()), true)
|
||||
.appendLine("Old Name: `%s`".formatted(event.getOldValue()), true)
|
||||
.appendLine("New Name: `%s`".formatted(event.getNewValue()), true)
|
||||
.setDescription(description
|
||||
.build())
|
||||
.build());
|
||||
}
|
||||
|
Reference in New Issue
Block a user