View Source Nostrum.Struct.Interaction (Nostrum v0.10.0)
Application command and Component invocation struct.
Summary
Types
ID of the application that this interaction is for
PartialChannel object for the channel where the command was invoked
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
Types
@type 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.
@type channel() :: Nostrum.Struct.Channel.t() | nil
PartialChannel object for the channel where the command was invoked
At the time of writing, only the fields :type
and :id
are guaranteed to be present.
@type channel_id() :: Nostrum.Struct.Channel.id()
ID of the channel where the command was invoked
@type data() :: Nostrum.Struct.ApplicationCommandInteractionData.t() | nil
Invocation data.
Only present for ApplicationCommand and MessageComponent interactions, that is, type=2
or type=3
.
@type guild_id() :: Nostrum.Struct.Guild.id() | nil
ID of the guild where the command was invoked
@type guild_locale() :: String.t() | nil
The guild's preferred locale, if invoked in a guild.
@type id() :: Nostrum.Snowflake.t()
Interaction identifier
@type locale() :: String.t() | nil
The selected langauge of the invoking user.
Available on all interaction types except for PING
@type member() :: Nostrum.Struct.Guild.Member.t() | nil
Member information about the invoker, if invoked on a guild
@type message() :: Nostrum.Struct.Message.t() | nil
For components, the message they were attached to
@type t() :: %Nostrum.Struct.Interaction{ application_id: application_id(), channel: channel(), 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
@type token() :: String.t() | nil
Continuation token for responses
Will be nil
if this interaction is part of a message struct.
@type type() :: 1..5
Interaction kind.
1
for Ping2
for ApplicationCommand3
for MessageComponent4
for ApplicationCommandAutocomplete5
for ModalSubmit
@type user() :: Nostrum.Struct.User.t() | nil
User object for the invoking user, will be a copy of member.user
if invoked in a guild
@type version() :: pos_integer() | nil
Version identifier, always 1
Will be nil
if this interaction is part of a message struct.