Class InteractionImpl

java.lang.Object
net.dv8tion.jda.internal.interactions.InteractionImpl
All Implemented Interfaces:
ISnowflake, Interaction
Direct Known Subclasses:
CommandAutoCompleteInteractionImpl, CommandInteractionPayloadImpl, DeferrableInteractionImpl

public class InteractionImpl extends Object implements Interaction
  • Constructor Details

  • Method Details

    • releaseHook

      public void releaseHook(boolean success)
    • ack

      public boolean ack()
    • isAcknowledged

      public boolean isAcknowledged()
      Description copied from interface: Interaction
      Whether this interaction has already been acknowledged.
      Each interaction can only be acknowledged once.
      Specified by:
      isAcknowledged in interface Interaction
      Returns:
      True, if this interaction has already been acknowledged
    • getIdLong

      public long getIdLong()
      Description copied from interface: ISnowflake
      The Snowflake id of this entity. This is unique to every entity and will never change.
      Specified by:
      getIdLong in interface ISnowflake
      Returns:
      Long containing the Id.
    • getTypeRaw

      public int getTypeRaw()
      Description copied from interface: Interaction
      The raw interaction type.
      It is recommended to use Interaction.getType() instead.
      Specified by:
      getTypeRaw in interface Interaction
      Returns:
      The raw interaction type
    • getToken

      @Nonnull public String getToken()
      Description copied from interface: Interaction
      The interaction token used for responding to an interaction.
      Specified by:
      getToken in interface Interaction
      Returns:
      The interaction token
    • getGuild

      @Nullable public Guild getGuild()
      Description copied from interface: Interaction
      The Guild this interaction happened in.
      This is null in direct messages.
      Specified by:
      getGuild in interface Interaction
      Returns:
      The Guild or null
    • getChannel

      @Nullable public Channel getChannel()
      Description copied from interface: Interaction
      The channel this interaction happened in.
      Specified by:
      getChannel in interface Interaction
      Returns:
      The channel or null if the channel is not provided
    • getChannelIdLong

      public long getChannelIdLong()
      Description copied from interface: Interaction
      The ID of the channel this interaction happened in.
      This might be 0 if no channel context is provided in future interaction types.
      Specified by:
      getChannelIdLong in interface Interaction
      Returns:
      The channel ID, or 0 if no channel context is provided
    • getUserLocale

      @Nonnull public DiscordLocale getUserLocale()
      Description copied from interface: Interaction
      Returns the selected language of the invoking user.
      Specified by:
      getUserLocale in interface Interaction
      Returns:
      The language of the invoking user
    • getContext

      @Nonnull public InteractionContextType getContext()
      Description copied from interface: Interaction
      Gets the context in which this command was executed.
      Specified by:
      getContext in interface Interaction
      Returns:
      The context in which this command was executed
    • getIntegrationOwners

      @Nonnull public IntegrationOwners getIntegrationOwners()
      Description copied from interface: Interaction
      Returns the integration owners of this interaction, which depends on how the app was installed.
      Specified by:
      getIntegrationOwners in interface Interaction
      Returns:
      The integration owners of this interaction
    • getUser

      @Nonnull public User getUser()
      Description copied from interface: Interaction
      The User who caused this interaction.
      Specified by:
      getUser in interface Interaction
      Returns:
      The User
    • getMember

      @Nullable public Member getMember()
      Description copied from interface: Interaction
      The Member who caused this interaction.
      This is null if the interaction is not from a guild.
      Specified by:
      getMember in interface Interaction
      Returns:
      The Member
    • getEntitlements

      @Nonnull public List<Entitlement> getEntitlements()
      Description copied from interface: Interaction
      Returns the list of entitlements for the current guild and user.
      If this interaction is not from a guild, it will only contain entitlements of the user.
      Specified by:
      getEntitlements in interface Interaction
      Returns:
      The List of Entitlement
    • getJDA

      @Nonnull public JDA getJDA()
      Description copied from interface: Interaction
      Returns the JDA instance of this interaction
      Specified by:
      getJDA in interface Interaction
      Returns:
      the corresponding JDA instance