Merge pull request #72 from Doc94/feature/slash-channel-list

Add support for target-text-channels for Slash Commands
This commit is contained in:
Joe 2022-06-02 21:10:36 +01:00 committed by GitHub
commit f60ad91478
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -328,6 +328,13 @@ public class DiscordClient extends ListenerAdapter {
return;
}
if (!Arrays.asList(targetTextChannels).contains(event.getTextChannel().getId())) {
MessageEmbed messageEmbed = CreateEmbeddedMessage("Sorry!",
("This bot can only used in the specified channel."), EmbedMessageType.FAILURE).build();
ReplyAndRemoveAfterSeconds(event, messageEmbed);
return;
}
String subcommand = event.getSubcommandName();
OptionMapping mc_name_op = event.getOption("minecraft_username");
String mc_name = null;