Compare commits

...

3 Commits

Author SHA1 Message Date
Joe f60ad91478
Merge pull request #72 from Doc94/feature/slash-channel-list
Add support for target-text-channels for Slash Commands
2022-06-02 21:10:36 +01:00
Doc deeb688146
Fix word 2022-01-20 16:29:48 -03:00
Doc 7bd2effa24
Add support for target-text-channels for Slash Commands 2022-01-20 16:22:46 -03:00
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;