Use Java 16 "instanceof" pattern matching
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
980cf5eef3
commit
668375367a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user