Package discord4j.core.object.command
Class ApplicationCommandInteraction
java.lang.Object
discord4j.core.object.command.ApplicationCommandInteraction
- All Implemented Interfaces:
DiscordObject
A Discord application command interaction.
- See Also:
-
Constructor Summary
ConstructorDescriptionApplicationCommandInteraction
(GatewayDiscordClient gateway, discord4j.discordjson.json.ApplicationCommandInteractionData data, Long guildId) Constructs anApplicationCommandInteraction
with an associatedGatewayDiscordClient
and Discord data. -
Method Summary
Modifier and TypeMethodDescriptionGets the type of the invoked command.Returns theGatewayDiscordClient
that created this object.Gets the components of the submitted modal.Gets the type of the component.Gets the developer-defined custom id of the component.getId()
Gets the id of the invoked command.getName()
Gets the name of the invoked command.Gets the option corresponding to the provided name, if present.Gets the options of the invoked command.Gets the converted users + roles + channels + attachments.Gets the ID of the user or message targeted by a user or message command.Gets the values selected if this is a select menu interaction.toString()
-
Constructor Details
-
ApplicationCommandInteraction
public ApplicationCommandInteraction(GatewayDiscordClient gateway, discord4j.discordjson.json.ApplicationCommandInteractionData data, @Nullable Long guildId) Constructs anApplicationCommandInteraction
with an associatedGatewayDiscordClient
and Discord data.- Parameters:
gateway
- TheGatewayDiscordClient
associated to this object, must be non-null.data
- The raw data as represented by Discord, must be non-null.
-
-
Method Details
-
getId
Gets the id of the invoked command.- Returns:
- The id of the invoked command.
-
getName
Gets the name of the invoked command.- Returns:
- The name of the invoked command.
-
getApplicationCommandType
Gets the type of the invoked command.- Returns:
- The type of the invoked command.
-
getCustomId
Gets the developer-defined custom id of the component.- Returns:
- The custom id of the component.
-
getComponentType
Gets the type of the component.- Returns:
- The type of the component.
-
getOptions
Gets the options of the invoked command.- Returns:
- The options of the invoked command.
-
getOption
Gets the option corresponding to the provided name, if present.- Parameters:
name
- The name of the option.- Returns:
- The option corresponding to the provided name, if present.
-
getValues
Gets the values selected if this is a select menu interaction.- Returns:
- The select menu values selected.
-
getResolved
Gets the converted users + roles + channels + attachments.- Returns:
- The converted users + roles + channels + attachments.
-
getTargetId
Gets the ID of the user or message targeted by a user or message command.- Returns:
- The id of the user or message targeted.
-
getComponents
Gets the components of the submitted modal.- Returns:
- The components of the submitted modal.
-
getClient
Description copied from interface:DiscordObject
Returns theGatewayDiscordClient
that created this object. Methods in it are exclusively based on the entity cache orStore
in use. Refer to callinggetClient().rest()
to access aDiscordClient
that is capable of requesting entities directly from the REST API.- Specified by:
getClient
in interfaceDiscordObject
- Returns:
- The
GatewayDiscordClient
associated to this object.
-
toString
-