Class InteractionEventImpl

java.lang.Object
net.essentialsx.discord.interactions.InteractionEventImpl
All Implemented Interfaces:
InteractionEvent

public class InteractionEventImpl extends Object implements InteractionEvent
A class which provides information about what triggered an interaction event.
  • Constructor Details

    • InteractionEventImpl

      public InteractionEventImpl(net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent jdaEvent)
  • Method Details

    • reply

      public void reply(String message)
      Description copied from interface: InteractionEvent
      Appends the given string to the initial response message and creates one if it doesn't exist.
      Specified by:
      reply in interface InteractionEvent
      Parameters:
      message - The message to append.
    • replyTl

      public void replyTl(String tlKey, Object... args)
      Description copied from interface: InteractionEvent
      Appends the given string to the initial response message and creates one if it doesn't exist.
      Specified by:
      replyTl in interface InteractionEvent
      Parameters:
      tlKey - The tlKey of the message to append.
      args - The args for the message to append.
    • getMember

      public InteractionMember getMember()
      Description copied from interface: InteractionEvent
      Gets the member which caused this event.
      Specified by:
      getMember in interface InteractionEvent
      Returns:
      the member which caused the event.
    • getStringArgument

      public String getStringArgument(String key)
      Description copied from interface: InteractionEvent
      Get the value of the argument matching the given key represented as a String, or null if no argument by that name is present.
      Specified by:
      getStringArgument in interface InteractionEvent
      Parameters:
      key - The key of the argument to lookup.
      Returns:
      the string value or null.
    • getIntegerArgument

      public Long getIntegerArgument(String key)
      Description copied from interface: InteractionEvent
      Get the Long representation of the argument by the given key or null if none by that key is present.
      Specified by:
      getIntegerArgument in interface InteractionEvent
      Parameters:
      key - The key of the argument to lookup.
      Returns:
      the long value or null
    • getBooleanArgument

      public Boolean getBooleanArgument(String key)
      Description copied from interface: InteractionEvent
      Helper method to get the Boolean representation of the argument by the given key or null if none by that key is present.
      Specified by:
      getBooleanArgument in interface InteractionEvent
      Parameters:
      key - The key of the argument to lookup.
      Returns:
      the boolean value or null
    • getUserArgument

      public InteractionMember getUserArgument(String key)
      Description copied from interface: InteractionEvent
      Helper method to get the user representation of the argument by the given key or null if none by that key is present.
      Specified by:
      getUserArgument in interface InteractionEvent
      Parameters:
      key - The key of the argument to lookup.
      Returns:
      the user value or null
    • getChannelArgument

      public InteractionChannel getChannelArgument(String key)
      Description copied from interface: InteractionEvent
      Helper method to get the channel representation of the argument by the given key or null if none by that key is present.
      Specified by:
      getChannelArgument in interface InteractionEvent
      Parameters:
      key - The key of the argument to lookup.
      Returns:
      the channel value or null
    • getRoleArgument

      public InteractionRole getRoleArgument(String key)
      Description copied from interface: InteractionEvent
      Helper method to get the role representation of the argument by the given key or null if none by that key is present.
      Specified by:
      getRoleArgument in interface InteractionEvent
      Parameters:
      key - The key of the argument to lookup.
      Returns:
      the role value or null
    • getChannelId

      public String getChannelId()
      Description copied from interface: InteractionEvent
      Gets the channel ID where this interaction occurred.
      Specified by:
      getChannelId in interface InteractionEvent
      Returns:
      the channel ID.