Class SlashCommand.Subcommand
java.lang.Object
xyz.dynxsty.dih4jda.interactions.commands.CommandRequirements
xyz.dynxsty.dih4jda.interactions.commands.SlashCommand.Subcommand
- Enclosing class:
SlashCommand
Model class which represents a single Subcommand.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidexecute(net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent event) Method that should be overridden for all Slash Commands that should be executed.final net.dv8tion.jda.api.interactions.commands.build.SubcommandDatafinal voidsetSubcommandData(net.dv8tion.jda.api.interactions.commands.build.SubcommandData subCommandData) Sets this subcommands'SubcommandData.Methods inherited from class xyz.dynxsty.dih4jda.interactions.commands.CommandRequirements
getRequiredPermissions, getRequiredRoles, getRequiredUsers, requirePermissions, requireRoles, requireUsers
-
Constructor Details
-
Subcommand
public Subcommand()
-
-
Method Details
-
getSubcommandData
public final net.dv8tion.jda.api.interactions.commands.build.SubcommandData getSubcommandData() -
setSubcommandData
public final void setSubcommandData(net.dv8tion.jda.api.interactions.commands.build.SubcommandData subCommandData) Sets this subcommands'SubcommandData.- Parameters:
subCommandData- TheSubcommandDatawhich should be used for this subcommand.- See Also:
-
SubcommandData
-
execute
public abstract void execute(net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent event) Method that should be overridden for all Slash Commands that should be executed.public class PingCommand extends SlashCommand.Subcommand { public PingCommand() { setSubcommandData(Commands.slash("ping", "Ping!")); } @Override public void execute(SlashCommandInteractionEvent event) { event.reply("Pong!").queue(); } }- Since:
- v1.5
-