Lingo.Type.Interaction (Lingo v0.4.2)

Copy Markdown View Source

A raw interaction. Bot callbacks get a Lingo.Context instead, which wraps it.

guild and channel are partial: Discord sends a guild's id, features and locale (here preferred_locale). data is Discord's raw interaction data, which Lingo.Context parses.

Summary

Functions

The user who triggered the interaction, in a guild or a DM.

Types

interaction_type()

@type interaction_type() ::
  :ping
  | :application_command
  | :message_component
  | :autocomplete
  | :modal_submit

t()

@type t() :: %Lingo.Type.Interaction{
  app_permissions: String.t() | nil,
  application_id: String.t(),
  attachment_size_limit: integer() | nil,
  authorizing_integration_owners: map() | nil,
  channel: Lingo.Type.Channel.t() | nil,
  channel_id: String.t() | nil,
  context: integer() | nil,
  data: map() | nil,
  entitlements: [Lingo.Type.Entitlement.t()],
  guild: Lingo.Type.Guild.t() | nil,
  guild_id: String.t() | nil,
  guild_locale: String.t() | nil,
  id: String.t(),
  locale: String.t() | nil,
  member: Lingo.Type.Member.t() | nil,
  message: Lingo.Type.Message.t() | nil,
  token: String.t(),
  type: interaction_type(),
  user: Lingo.Type.User.t() | nil,
  version: integer()
}

Functions

author(interaction)

@spec author(t()) :: Lingo.Type.User.t() | nil

The user who triggered the interaction, in a guild or a DM.