Use Java 16 "instanceof" pattern matching
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Bea 2023-01-16 07:15:51 +01:00
parent 980cf5eef3
commit 668375367a
1 changed files with 2 additions and 2 deletions

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