View Source Nostrum.Struct.Interaction (Nostrum v0.6.0)
Application command and Component invocation struct.
Link to this section Summary
Types
ID of the application that this interaction is for
ID of the channel where the command was invoked
Invocation data.
ID of the guild where the command was invoked
The guild's preferred locale, if invoked in a guild.
Interaction identifier
The selected langauge of the invoking user.
Member information about the invoker, if invoked on a guild
For components, the message they were attached to
A command invocation for Application Commands or Components.
Continuation token for responses
Interaction kind.
User object for the invoking user, will be a copy of member.user
if invoked in a guild
Version identifier, always 1
Link to this section Types
Specs
application_id() :: Nostrum.Snowflake.t() | nil
ID of the application that this interaction is for
Will be nil
if the interaction was part of a message struct.
Specs
channel_id() :: Nostrum.Struct.Channel.id()
ID of the channel where the command was invoked
Specs
data() :: Nostrum.Struct.ApplicationCommandInteractionData.t() | nil
Invocation data.
Only present for ApplicationCommand and MessageComponent interactions, that is, type=2
or type=3
.
Specs
guild_id() :: Nostrum.Struct.Guild.id() | nil
ID of the guild where the command was invoked
Specs
guild_locale() :: String.t() | nil
The guild's preferred locale, if invoked in a guild.
Specs
id() :: Nostrum.Snowflake.t()
Interaction identifier
Specs
locale() :: String.t() | nil
The selected langauge of the invoking user.
Available on all interaction types except for PING
Specs
member() :: Nostrum.Struct.Guild.Member.t() | nil
Member information about the invoker, if invoked on a guild
Specs
message() :: Nostrum.Struct.Message.t() | nil
For components, the message they were attached to
Specs
t() :: %Nostrum.Struct.Interaction{ application_id: application_id(), channel_id: channel_id(), data: data(), guild_id: guild_id(), guild_locale: guild_locale(), id: id(), locale: locale(), member: member(), message: message(), token: token(), type: type(), user: user(), version: version() }
A command invocation for Application Commands or Components.
Official reference: https://discord.com/developers/docs/interactions/application-commands
Specs
token() :: String.t() | nil
Continuation token for responses
Will be nil
if this interaction is part of a message struct.
Specs
type() :: 1..5
Interaction kind.
1
for Ping2
for ApplicationCommand3
for MessageComponent4
for ApplicationCommandAutocomplete5
for ModalSubmit
Specs
user() :: Nostrum.Struct.User.t() | nil
User object for the invoking user, will be a copy of member.user
if invoked in a guild
Specs
version() :: pos_integer() | nil
Version identifier, always 1
Will be nil
if this interaction is part of a message struct.