Bat/src/main/java/cc/fascinated/bat/command/BatSubCommand.java

46 lines
1.3 KiB
Java
Raw Normal View History

2024-06-24 13:56:01 +01:00
package cc.fascinated.bat.command;
import lombok.Getter;
2024-06-27 16:24:08 +01:00
import lombok.Setter;
import net.dv8tion.jda.api.interactions.commands.OptionType;
import net.dv8tion.jda.api.interactions.commands.build.SubcommandData;
2024-06-24 13:56:01 +01:00
/**
* @author Fascinated (fascinated7)
*/
2024-06-28 03:01:21 +01:00
@Getter
@Setter
public class BatSubCommand implements BatCommandExecutor {
/**
2024-06-27 19:36:52 +01:00
* The information about the sub command
*/
2024-06-27 19:36:52 +01:00
private final CommandInfo commandInfo;
/**
2024-06-27 19:36:52 +01:00
* The command data for the slash command
*/
2024-06-27 19:36:52 +01:00
private final SubcommandData commandData;
2024-06-27 16:24:08 +01:00
/**
* The commands snowflake from Discord
*/
private long commandSnowflake;
2024-06-27 19:36:52 +01:00
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
*
2024-06-28 03:01:21 +01:00
* @param optionType the type of the option
* @param name the name of the option
* @param description the description of the option
2024-06-28 03:01:21 +01:00
* @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);
}
}