forked from Fascinated/Bat
42 lines
1.2 KiB
Java
42 lines
1.2 KiB
Java
package cc.fascinated.bat.command;
|
|
|
|
import lombok.Getter;
|
|
import net.dv8tion.jda.api.Permission;
|
|
import net.dv8tion.jda.api.interactions.commands.OptionType;
|
|
import net.dv8tion.jda.api.interactions.commands.build.SubcommandData;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* @author Fascinated (fascinated7)
|
|
*/
|
|
@Getter
|
|
public class BatSubCommand implements BatCommandExecutor {
|
|
/**
|
|
* The command data for the slash command
|
|
*/
|
|
private final SubcommandData commandData;
|
|
|
|
/**
|
|
* The required permissions for the command
|
|
*/
|
|
private final List<Permission> requiredPermissions;
|
|
|
|
public BatSubCommand(String name, String description, Permission... permissions) {
|
|
this.commandData = new SubcommandData(name, description);
|
|
this.requiredPermissions = List.of(permissions);
|
|
}
|
|
|
|
/**
|
|
* Adds an option to the sub command
|
|
*
|
|
* @param optionType the type of the option
|
|
* @param name the name of the option
|
|
* @param description the description of the option
|
|
* @param required whether the option is required
|
|
*/
|
|
public void addOption(OptionType optionType, String name, String description, boolean required) {
|
|
this.commandData.addOption(optionType, name, description, required);
|
|
}
|
|
}
|