Add support for target-text-channels for Slash Commands

This commit is contained in:
Doc 2022-01-20 16:22:46 -03:00
parent 1e041083e1
commit 7bd2effa24
No known key found for this signature in database
GPG Key ID: 20C3B20323EFD295
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 chcannel."), EmbedMessageType.FAILURE).build();
ReplyAndRemoveAfterSeconds(event, messageEmbed);
return;
}
String subcommand = event.getSubcommandName();
OptionMapping mc_name_op = event.getOption("minecraft_username");
String mc_name = null;