Class BaseApplicationCommand<E extends net.dv8tion.jda.api.events.interaction.command.GenericCommandInteractionEvent,T>
java.lang.Object
xyz.dynxsty.dih4jda.interactions.commands.RestrictedCommand
xyz.dynxsty.dih4jda.interactions.commands.application.ApplicationCommand<E,T>
xyz.dynxsty.dih4jda.interactions.commands.application.BaseApplicationCommand<E,T>
- Type Parameters:
E
- The event this class uses.T
- The type ofCommandData
this class uses.
- All Implemented Interfaces:
ExecutableCommand<E>
- Direct Known Subclasses:
ContextCommand
,SlashCommand
public abstract class BaseApplicationCommand<E extends net.dv8tion.jda.api.events.interaction.command.GenericCommandInteractionEvent,T>
extends ApplicationCommand<E,T>
An extension of
ApplicationCommand
which contains a RegistrationType
and queueableGuilds
.
This abstract class is meant for top-level commands, which can be queued either per-guild or globally.-
Nested Class Summary
Nested classes/interfaces inherited from class xyz.dynxsty.dih4jda.interactions.commands.RestrictedCommand
RestrictedCommand.Cooldown
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionLong[]
Gets all the guilds that the command should be registered/queued in.final RegistrationType
TheRegistrationType
the command got assigned.void
setQueueableGuilds
(Long... queueableGuilds) Limits this command to only be queued in the specified guilds.final void
How the command should be queued.Methods inherited from class xyz.dynxsty.dih4jda.interactions.commands.application.ApplicationCommand
getCommandData, setCommandData
Methods inherited from class xyz.dynxsty.dih4jda.interactions.commands.RestrictedCommand
applyCooldown, getCommandCooldown, getRequiredGuilds, getRequiredPermissions, getRequiredRoles, getRequiredUsers, hasCooldown, retrieveCooldown, setCommandCooldown, setRequiredGuilds, setRequiredPermissions, setRequiredRoles, setRequiredUsers
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface xyz.dynxsty.dih4jda.interactions.commands.ExecutableCommand
execute
-
Constructor Details
-
BaseApplicationCommand
public BaseApplicationCommand()Creates a defaultBaseApplicationCommand
.
-
-
Method Details
-
getRegistrationType
TheRegistrationType
the command got assigned.- Returns:
- the
RegistrationType
.
-
setRegistrationType
How the command should be queued. This DOES NOT work withSlashCommand.Subcommand
!- Parameters:
type
- theRegistrationType
to set.
-
setQueueableGuilds
Limits this command to only be queued in the specified guilds. Leave this blank (or null) if the command should be queued everywhere.- Parameters:
queueableGuilds
- The guild ids, as aLong
array.
-
getQueueableGuilds
Gets all the guilds that the command should be registered/queued in.- Returns:
- the guild ids as an array of
Long
s.
-