Class CommandInteractionPayloadImpl
java.lang.Object
net.dv8tion.jda.internal.interactions.InteractionImpl
net.dv8tion.jda.internal.interactions.command.CommandInteractionPayloadImpl
- All Implemented Interfaces:
ISnowflake
,CommandInteractionPayload
,Interaction
public class CommandInteractionPayloadImpl
extends InteractionImpl
implements CommandInteractionPayload
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe channel this interaction happened in.long
The command id.TheType
of command this interaction is for.getName()
The command name.The options provided by the user when this command was executed.The subcommand group name.The subcommand name.boolean
Whether the used command is a guild command.Methods inherited from class net.dv8tion.jda.internal.interactions.InteractionImpl
ack, getChannelIdLong, getContext, getEntitlements, getGuild, getIdLong, getIntegrationOwners, getJDA, getMember, getToken, getTypeRaw, getUser, getUserLocale, isAcknowledged, releaseHook
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.dv8tion.jda.api.interactions.commands.CommandInteractionPayload
getCommandId, getCommandString, getFullCommandName, getOption, getOption, getOption, getOption, getOptionsByName, getOptionsByType, isGlobalCommand
Methods inherited from interface net.dv8tion.jda.api.interactions.Interaction
getChannelId, getChannelIdLong, getChannelType, getContext, getEntitlements, getGuild, getGuildChannel, getGuildLocale, getIntegrationOwners, getJDA, getMember, getMessageChannel, getToken, getType, getTypeRaw, getUser, getUserLocale, isAcknowledged, isFromAttachedGuild, isFromGuild
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Constructor Details
-
CommandInteractionPayloadImpl
-
-
Method Details
-
getChannel
Description copied from interface:Interaction
The channel this interaction happened in.- Specified by:
getChannel
in interfaceInteraction
- Overrides:
getChannel
in classInteractionImpl
- Returns:
- The channel or null if the channel is not provided
-
getCommandType
Description copied from interface:CommandInteractionPayload
TheType
of command this interaction is for.- Specified by:
getCommandType
in interfaceCommandInteractionPayload
- Returns:
- The command type
-
getName
Description copied from interface:CommandInteractionPayload
The command name.
This can be useful for abstractions.Note that commands can have these following structures:
/name subcommandGroup subcommandName
/name subcommandName
/name
CommandInteractionPayload.getFullCommandName()
to simplify your checks.- Specified by:
getName
in interfaceCommandInteractionPayload
- Returns:
- The command name
-
getSubcommandName
Description copied from interface:CommandInteractionPayload
The subcommand name.
This can be useful for abstractions.Note that commands can have these following structures:
/name subcommandGroup subcommandName
/name subcommandName
/name
CommandInteractionPayload.getFullCommandName()
to simplify your checks.- Specified by:
getSubcommandName
in interfaceCommandInteractionPayload
- Returns:
- The subcommand name, or null if this is not a subcommand
-
getSubcommandGroup
Description copied from interface:CommandInteractionPayload
The subcommand group name.
This can be useful for abstractions.Note that commands can have these following structures:
/name subcommandGroup subcommandName
/name subcommandName
/name
CommandInteractionPayload.getFullCommandName()
to simplify your checks.- Specified by:
getSubcommandGroup
in interfaceCommandInteractionPayload
- Returns:
- The subcommand group name, or null if this is not a subcommand group
-
getCommandIdLong
public long getCommandIdLong()Description copied from interface:CommandInteractionPayload
The command id.
This is the id generated when a command is created viaGuild.updateCommands()
or similar.It is usually preferred to discriminate commands by the
command names
instead.- Specified by:
getCommandIdLong
in interfaceCommandInteractionPayload
- Returns:
- The command id
-
isGuildCommand
public boolean isGuildCommand()Description copied from interface:CommandInteractionPayload
Whether the used command is a guild command.Guild commands can be created with
Guild.upsertCommand(CommandData)
.- Specified by:
isGuildCommand
in interfaceCommandInteractionPayload
- Returns:
- True, if the used command is a guild command
-
getOptions
Description copied from interface:CommandInteractionPayload
The options provided by the user when this command was executed.
Each option has a name and value.For
CommandAutoCompleteInteraction
, this might be incomplete and unvalidated. Auto-complete interactions happen on incomplete command inputs and are not validated.- Specified by:
getOptions
in interfaceCommandInteractionPayload
- Returns:
- The options passed for this command
- See Also:
-