You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO: Check if its possible to extend SlashCommandInteractionEvent
importjava.util.List;
/** * Command creation system */publicabstractclassSimpleSlashCommandextendsListenerAdapter {
/** * The command name, eg. /about or /ping */privatefinalStringcommand/** * You can set the cooldown time before executing the command again. This map * stores the player uuid and his last execution of the command. */privatefinalExpiringMap<User, Long> cooldownMap = ExpiringMap.builder().expiration(30, TimeUnit.MINUTES).build();
/** * The command cooldown before we can run this command again */@GetterprivateintcooldownSeconds = 0;
/** * The users that are allowd to bypass this command's cooldown, if it is set */privateList<User> cooldownBypassUsers = null/** * The permissions that are allowd to bypass this command's cooldown, if it is set */privateList<Permission> cooldownBypassPermission = null/** * A custom message when the user attempts to run this command * within {@link #cooldownSeconds}. By default we use the line below * <p> * TIP: Use {duration} to replace the remaining time till next run */privateStringcooldownMessage = "The command you used is in cooldow you can use this command after {duration}";
/** * Send the cooldownMessage in a embed or as a normal message */privatebooleancooldownMessageAsEmbed = true/** * If the command can only be ran in the main guild of the bot * <p> * The mainGuild is set inside {@link SimpleBot#setMainGuild} */privatebooleanmainGuildOnly = false;
/** * Users that can't use this command */privateList<User> disabledUsers = null/** * Roles that can't use this command */privateList<Role> disabledRoles = null;
/** * Channels that aren't allowed to use this command */privateList<Channel> disabledChannels = null/** * Users that are allowed use this command */privateList<User> allowedUsers = null;
/** * Roles that are allowed use this command */privateList<Role> allowedRoles = null;
/** * Channels where this command is allowed */privateList<Channel> allowedChannels = null;
// ----------------------------------------------------------------------------------------// Temporary variables// ----------------------------------------------------------------------------------------/** * The command User * <p> * This variable is set dynamically when the command is run with the * last known user */protectedUseruser;
/** * The command Member * <p> * This variable is set dynamically when the command is run with the * last known member */protectedMembermember;
/** * The command Guild * <p> * This variable is set dynamically when the command is run with the * last known guild */protectedGuilgguild;
// ---------------------------------------------------------------------------------------- /** * The main method to create the command */protectedSimpleSlashCommand(finalStringcommand) {
super(command)
this.command = command;
}
// ----------------------------------------------------------------------------------------// Registration// ----------------------------------------------------------------------------------------// TODO: Register command// ----------------------------------------------------------------------------------------// Execution// ----------------------------------------------------------------------------------------// TODO: Check if its possible to extend SlashCommandInteractionEvent@Overridepublicfinalbooleanexecute(finalSlashCommandInteractionEventevent) {
this.user = event.getuser();
this.member = event.getMember();
this.guild = event.getGuild();
}
// ----------------------------------------------------------------------------------------// OLD SYSTEM// ----------------------------------------------------------------------------------------/** * The actual command itself */
The text was updated successfully, but these errors were encountered:
OLD SYSTEM
Discord_Bot_Foundation/src/main/java/com/greazi/discordbotfoundation/handlers/commands/SimpleSlashCommand.java
Line 157 in 827de0a
The text was updated successfully, but these errors were encountered: