forked from Fascinated/Bat
45 lines
1.3 KiB
Java
45 lines
1.3 KiB
Java
package cc.fascinated.bat.command;
|
|
|
|
import lombok.Getter;
|
|
import lombok.Setter;
|
|
import net.dv8tion.jda.api.interactions.commands.OptionType;
|
|
import net.dv8tion.jda.api.interactions.commands.build.SubcommandData;
|
|
|
|
/**
|
|
* @author Fascinated (fascinated7)
|
|
*/
|
|
@Getter @Setter
|
|
public class BatSubCommand implements BatCommandExecutor {
|
|
/**
|
|
* The information about the sub command
|
|
*/
|
|
private final CommandInfo commandInfo;
|
|
|
|
/**
|
|
* The command data for the slash command
|
|
*/
|
|
private final SubcommandData commandData;
|
|
|
|
/**
|
|
* The commands snowflake from Discord
|
|
*/
|
|
private long commandSnowflake;
|
|
|
|
public BatSubCommand() {
|
|
this.commandInfo = getClass().getAnnotation(CommandInfo.class);
|
|
this.commandData = new SubcommandData(this.commandInfo.name(), this.commandInfo.description());
|
|
}
|
|
|
|
/**
|
|
* 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);
|
|
}
|
|
}
|