Class GenericInteractionCreateEvent
java.lang.Object
net.dv8tion.jda.api.events.Event
net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent
- All Implemented Interfaces:
ISnowflake,GenericEvent,Interaction
- Direct Known Subclasses:
GenericAutoCompleteInteractionEvent,GenericCommandInteractionEvent,GenericComponentInteractionCreateEvent,ModalInteractionEvent
Indicates that an
Every interaction event is derived from this event.
Interaction was created.
Every interaction event is derived from this event.
Requirements
To receive these events, you must unset the Interactions Endpoint URL in your application dashboard.
You can simply remove the URL for this endpoint in your settings at the Discord Developers Portal.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGenericInteractionCreateEvent(JDA api, long responseNumber, Interaction interaction) -
Method Summary
Modifier and TypeMethodDescriptionThe channel this interaction happened in.longThe ID of the channel this interaction happened in.Gets the context in which this command was executed.Returns the list ofentitlementsfor the current guild and user.getGuild()TheGuildthis interaction happened in.Returns the preferred language of the Guild.longThe Snowflake id of this entity.Returns the integration owners of this interaction, which depends on how the app was installed.TheInteractioninstance.TheMemberwho caused this interaction.getToken()The interaction token used for responding to an interaction.intThe raw interaction type.getUser()TheUserwho caused this interaction.Returns the selected language of the invoking user.booleanWhether this interaction has already been acknowledged.Methods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getRawData, getResponseNumber, toStringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.dv8tion.jda.api.interactions.Interaction
getChannelId, getChannelType, getGuildChannel, getJDA, getMessageChannel, getType, isFromAttachedGuild, isFromGuildMethods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getTimeCreated
-
Constructor Details
-
GenericInteractionCreateEvent
public GenericInteractionCreateEvent(@Nonnull JDA api, long responseNumber, @Nonnull Interaction interaction)
-
-
Method Details
-
getInteraction
TheInteractioninstance.
Note that this event is a delegate which implements the same interface.- Returns:
- The
Interaction
-
getToken
Description copied from interface:InteractionThe interaction token used for responding to an interaction.- Specified by:
getTokenin interfaceInteraction- Returns:
- The interaction token
-
getTypeRaw
public int getTypeRaw()Description copied from interface:InteractionThe raw interaction type.
It is recommended to useInteraction.getType()instead.- Specified by:
getTypeRawin interfaceInteraction- Returns:
- The raw interaction type
-
getGuild
Description copied from interface:InteractionTheGuildthis interaction happened in.
This is null in direct messages.- Specified by:
getGuildin interfaceInteraction- Returns:
- The
Guildor null
-
getChannel
Description copied from interface:InteractionThe channel this interaction happened in.- Specified by:
getChannelin interfaceInteraction- Returns:
- The channel or null if the channel is not provided
-
getChannelIdLong
public long getChannelIdLong()Description copied from interface:InteractionThe ID of the channel this interaction happened in.
This might be 0 if no channel context is provided in future interaction types.- Specified by:
getChannelIdLongin interfaceInteraction- Returns:
- The channel ID, or 0 if no channel context is provided
-
getUserLocale
Description copied from interface:InteractionReturns the selected language of the invoking user.- Specified by:
getUserLocalein interfaceInteraction- Returns:
- The language of the invoking user
-
getGuildLocale
Description copied from interface:InteractionReturns the preferred language of the Guild.
This is identical togetGuild().getLocale().- Specified by:
getGuildLocalein interfaceInteraction- Returns:
- The preferred language of the Guild
-
getContext
Description copied from interface:InteractionGets the context in which this command was executed.- Specified by:
getContextin interfaceInteraction- Returns:
- The context in which this command was executed
-
getIntegrationOwners
Description copied from interface:InteractionReturns the integration owners of this interaction, which depends on how the app was installed.- Specified by:
getIntegrationOwnersin interfaceInteraction- Returns:
- The integration owners of this interaction
-
getMember
Description copied from interface:InteractionTheMemberwho caused this interaction.
This is null if the interaction is not from a guild.- Specified by:
getMemberin interfaceInteraction- Returns:
- The
Member
-
getUser
Description copied from interface:InteractionTheUserwho caused this interaction.- Specified by:
getUserin interfaceInteraction- Returns:
- The
User
-
getEntitlements
Description copied from interface:InteractionReturns the list ofentitlementsfor the current guild and user.
If this interaction is not from a guild, it will only contain entitlements of the user.- Specified by:
getEntitlementsin interfaceInteraction- Returns:
- The
ListofEntitlement
-
getIdLong
public long getIdLong()Description copied from interface:ISnowflakeThe Snowflake id of this entity. This is unique to every entity and will never change.- Specified by:
getIdLongin interfaceISnowflake- Returns:
- Long containing the Id.
-
isAcknowledged
public boolean isAcknowledged()Description copied from interface:InteractionWhether this interaction has already been acknowledged.
Each interaction can only be acknowledged once.- Specified by:
isAcknowledgedin interfaceInteraction- Returns:
- True, if this interaction has already been acknowledged
-