Nostrum.Struct.ApplicationCommandInteractionData (nostrum v0.11.0-dev)

View Source

Struct for interaction data.

Summary

Types

For components, the type of the component

For Modal Sumbit interactions, this will contain the values the user submitted.

For components, the custom_id of the component

ID of the invoked command

Name of the invoked command

Parameters and values supplied by the user, if applicable

Converted users & roles & channels

For select menu components, this will be a list of the values the user selected.

t()

Command interaction data for slash commands.

ID of the user or message targeted by a context menu command

Types

component_type()

(since 0.5.0)
@type component_type() :: integer() | nil

For components, the type of the component

components()

(since 0.5.1)
@type components() :: [Nostrum.Struct.Message.Component.t()] | nil

For Modal Sumbit interactions, this will contain the values the user submitted.

custom_id()

(since 0.5.0)
@type custom_id() :: String.t() | nil

For components, the custom_id of the component

id()

@type id() :: Nostrum.Snowflake.t() | nil

ID of the invoked command

interaction_type()

(since 0.5.0)
@type interaction_type() :: integer() | nil

The type of application command invoked. Official reference: https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types

name()

@type name() :: String.t() | nil

Name of the invoked command

options()

Parameters and values supplied by the user, if applicable

resolved()

(since 0.5.0)

Converted users & roles & channels

select_values()

(since 0.5.0)
@type select_values() :: [String.t()] | nil

For select menu components, this will be a list of the values the user selected.

t()

@type t() :: %Nostrum.Struct.ApplicationCommandInteractionData{
  component_type: component_type(),
  components: components(),
  custom_id: custom_id(),
  id: id(),
  name: name(),
  options: options(),
  resolved: resolved(),
  target_id: target_id(),
  type: interaction_type(),
  values: select_values()
}

Command interaction data for slash commands.

Used as part of Nostrum.Struct.Interaction.t/0.

Official reference: https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object

target_id()

(since 0.5.0)
@type target_id() :: Nostrum.Snowflake.t() | nil

ID of the user or message targeted by a context menu command