Class SlashCommand.Subcommand
java.lang.Object
xyz.dynxsty.dih4jda.interactions.commands.RestrictedCommand
xyz.dynxsty.dih4jda.interactions.commands.application.ApplicationCommand<net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent,net.dv8tion.jda.api.interactions.commands.build.SubcommandData>
xyz.dynxsty.dih4jda.interactions.commands.application.SlashCommand.Subcommand
- All Implemented Interfaces:
ExecutableCommand<net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent>
- Enclosing class:
SlashCommand
public abstract static class SlashCommand.Subcommand
extends ApplicationCommand<net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent,net.dv8tion.jda.api.interactions.commands.build.SubcommandData>
Model class which represents a single Subcommand.
-
Nested Class Summary
Nested classes/interfaces inherited from class xyz.dynxsty.dih4jda.interactions.commands.RestrictedCommand
RestrictedCommand.Cooldown -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.dv8tion.jda.api.interactions.commands.Command.SubcommandGets the correspondingJDA-entityfor this subcommand.Gets theparentfor this subcommand.Methods inherited from class xyz.dynxsty.dih4jda.interactions.commands.application.ApplicationCommand
getCommandData, setCommandDataMethods inherited from class xyz.dynxsty.dih4jda.interactions.commands.RestrictedCommand
applyCooldown, getCommandCooldown, getRequiredGuilds, getRequiredPermissions, getRequiredRoles, getRequiredUsers, hasCooldown, retrieveCooldown, setCommandCooldown, setRequiredGuilds, setRequiredPermissions, setRequiredRoles, setRequiredUsersMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface xyz.dynxsty.dih4jda.interactions.commands.ExecutableCommand
execute
-
Constructor Details
-
Subcommand
public Subcommand()Creates a default instance.
-
-
Method Details
-
getParent
Gets theparentfor this subcommand.- Returns:
- The corresponding
SlashCommand.
-
asSubcommand
@Nullable public net.dv8tion.jda.api.interactions.commands.Command.Subcommand asSubcommand()Gets the correspondingJDA-entityfor this subcommand. If the subcommand was not cached or queued before (e.g. when using sharding), this may return null.- Returns:
- The
Command.Subcommandcorresponding to this class.
-