Package discord4j.core.object
Class MessageInteraction
- java.lang.Object
-
- discord4j.core.object.MessageInteraction
-
- All Implemented Interfaces:
DiscordObject
public class MessageInteraction extends Object implements DiscordObject
A Discord Message Interaction.- See Also:
- Message Interaction Object
-
-
Constructor Summary
Constructors Constructor Description MessageInteraction(GatewayDiscordClient gateway, discord4j.discordjson.json.MessageInteractionData data)
Constructs aMessageInteraction
with an associatedGatewayDiscordClient
and Discord data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GatewayDiscordClient
getClient()
Returns theGatewayDiscordClient
that created this object.Snowflake
getId()
Gets the id of the interaction.String
getName()
Gets the name of theApplicationCommand
.ApplicationCommandOption.Type
getType()
Gets the type of interaction.User
getUser()
Gets the user who invoked the interaction.
-
-
-
Constructor Detail
-
MessageInteraction
public MessageInteraction(GatewayDiscordClient gateway, discord4j.discordjson.json.MessageInteractionData data)
Constructs aMessageInteraction
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 Detail
-
getId
public Snowflake getId()
Gets the id of the interaction.- Returns:
- The id of the interaction.
-
getType
public ApplicationCommandOption.Type getType()
Gets the type of interaction.- Returns:
- The type of interaction
-
getName
public String getName()
Gets the name of theApplicationCommand
.- Returns:
- The name of the
ApplicationCommand
.
-
getUser
public User getUser()
Gets the user who invoked the interaction.- Returns:
- The user who invoked the interaction.
-
getClient
public final GatewayDiscordClient 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.
-
-