Class Interaction

    • Constructor Detail

      • Interaction

        public Interaction​(GatewayDiscordClient gateway,
                           discord4j.discordjson.json.InteractionData data)
        Constructs an Interaction with an associated GatewayDiscordClient and Discord data.
        Parameters:
        gateway - The GatewayDiscordClient associated to this object, must be non-null.
        data - The raw data as represented by Discord, must be non-null.
    • Method Detail

      • getData

        public discord4j.discordjson.json.InteractionData getData()
      • getId

        public Snowflake getId()
        Gets the id of the interaction.
        Returns:
        The id of the interaction.
      • getApplicationId

        public Snowflake getApplicationId()
        Gets the id of the application this interaction is for.
        Returns:
        The id of the application this interaction is for.
      • getType

        public Interaction.Type getType()
        Gets the type of interaction.
        Returns:
        The type of interaction.
      • getGuildId

        public Optional<Snowflake> getGuildId()
        Gets the guild id it was sent from, if invoked in a guild.
        Returns:
        The guild id it was sent from, if invoked in a guild.
      • getGuild

        public Mono<Guild> getGuild()
        Gets the guild it was sent from, if invoked in a guild.
        Returns:
        The guild it was sent from, if invoked in a guild.
      • getChannelId

        public Snowflake getChannelId()
        Gets the channel id it was sent from.
        Returns:
        The channel id it was sent from.
      • getChannel

        public Mono<MessageChannel> getChannel()
        Gets the channel it was sent from.
        Returns:
        The channel it was sent from.
      • getMember

        public Optional<Member> getMember()
        Gets the invoking member, if invoked in a guild.
        Returns:
        The invoking member, if invoked in a guild.
      • getUser

        public User getUser()
        Gets the invoking user. The user data is extracted from the member if invoked in a guild.
        Returns:
        The invoking user. The user data is extracted from the member if invoked in a guild.
      • getToken

        public String getToken()
        Gets the continuation token for responding to the interaction.
        Returns:
        The continuation token for responding to the interaction.
      • getMessage

        public Optional<Message> getMessage()
        Gets the message associated with the interaction.
        Returns:
        The message associated with the interaction.
      • getMessageId

        public Optional<Snowflake> getMessageId()
        Gets the ID of the message associated with the interaction.
        Returns:
        The message associated with the interaction.