fix channel delete logging for non text channel channels
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 39s

This commit is contained in:
Lee 2024-07-04 04:32:14 +01:00
parent 490080b17a
commit f940bd526c

View File

@ -58,7 +58,7 @@ public class ChannelListener implements EventListener {
ChannelUnion channel = event.getChannel();
EmbedDescriptionBuilder description = new EmbedDescriptionBuilder("%s Channel Deleted".formatted(EnumUtils.getEnumName(channel.getType())))
.appendLine("Name: #%s".formatted(channel.getName()), true);
if (channel.getType().isMessage()) {
if (channel instanceof TextChannel) {
TextChannel textChannel = channel.asTextChannel();
description.appendLine("Topic: %s".formatted(textChannel.getTopic()), true);
}