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 aMessageInteractionwith an associatedGatewayDiscordClientand Discord data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GatewayDiscordClientgetClient()Returns theGatewayDiscordClientthat created this object.SnowflakegetId()Gets the id of the interaction.StringgetName()Gets the name of theApplicationCommand.ApplicationCommandOption.TypegetType()Gets the type of interaction.UsergetUser()Gets the user who invoked the interaction.
-
-
-
Constructor Detail
-
MessageInteraction
public MessageInteraction(GatewayDiscordClient gateway, discord4j.discordjson.json.MessageInteractionData data)
Constructs aMessageInteractionwith an associatedGatewayDiscordClientand Discord data.- Parameters:
gateway- TheGatewayDiscordClientassociated 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:DiscordObjectReturns theGatewayDiscordClientthat created this object. Methods in it are exclusively based on the entity cache orStorein use. Refer to callinggetClient().rest()to access aDiscordClientthat is capable of requesting entities directly from the REST API.- Specified by:
getClientin interfaceDiscordObject- Returns:
- The
GatewayDiscordClientassociated to this object.
-
-