Add command to stop bot process
All checks were successful
continuous-integration/drone/push Build is passing

Previously, anyone could send the keywords in chat and kill the bot. Now, only the set bot owner can run the command.
This commit is contained in:
2022-11-20 05:57:42 +01:00
parent bd76562bcc
commit dd4ffe252e
4 changed files with 24 additions and 13 deletions

View File

@@ -20,11 +20,13 @@ public class SlashCommandsUtil
static List<CommandData> allCommands = new ArrayList<>()
{{
add(Commands.slash("ping", "Test if the bot is responsive."));
add(Commands.slash("coinflip", "Flip a coin and get head or tails."));
add(Commands.slash("die", "Stop the bot's process")
.setDefaultPermissions(DefaultMemberPermissions.DISABLED));
add(Commands.slash("clear", "Clear the current channel's chat.")
.addOption(OptionType.INTEGER, "amount", "The amount of messages to delete.")
.setDefaultPermissions(DefaultMemberPermissions.enabledFor(Permission.MESSAGE_MANAGE)));
add(Commands.slash("coinflip", "Flip a coin and get head or tails."));
add(Commands.slash("ping", "Test if the bot is responsive."));
}};
public static void updateSlashCommands()