diff options
Diffstat (limited to 'src/main/java/net/tylermurphy/ken/command/nsfw/E621.java')
-rw-r--r-- | src/main/java/net/tylermurphy/ken/command/nsfw/E621.java | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/main/java/net/tylermurphy/ken/command/nsfw/E621.java b/src/main/java/net/tylermurphy/ken/command/nsfw/E621.java index a454f13..c9ea4fd 100644 --- a/src/main/java/net/tylermurphy/ken/command/nsfw/E621.java +++ b/src/main/java/net/tylermurphy/ken/command/nsfw/E621.java @@ -21,10 +21,9 @@ public class E621 { @Option(name="query",description="Search query for e621",type= OptionType.STRING,required=true) @Option(name="page",description="Page number for e621",type= OptionType.INTEGER) public Response execute(GuildMessageChannel channel, List<Object> args){ - if(!(channel instanceof TextChannel)) { + if(!(channel instanceof TextChannel textChannel)) { return Response.error("This command can only be used in a text channel"); } - TextChannel textChannel = (TextChannel) channel; if(!textChannel.isNSFW()){ return Response.error("This command can only be used in an NSFW channel"); } |