Use Java 16 "instanceof" pattern matching
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Bea 2023-01-16 07:15:51 +01:00
parent 980cf5eef3
commit 668375367a

View File

@ -25,9 +25,9 @@ public class MessageLogger extends ListenerAdapter
String userName = event.getAuthor().getAsTag();
String message = event.getMessage().getContentDisplay();
if(event.getChannel() instanceof TextChannel)
if(event.getChannel() instanceof TextChannel channel)
{
String guildName = ((TextChannel) event.getChannel()).getGuild().getName();
String guildName = channel.getGuild().getName();
String channelName = event.getChannel().getName();
toLog = GUILD_MESSAGE_LOG_FORMAT