Lingo.Type.Application (Lingo v0.4.2)

Copy Markdown View Source

An application: the bot's own, from Lingo.Api.Application.get_current/0, or a partial one inside messages, attachments and invites.

team, install_params and the values of integration_types_config are maps with atom keys. integration_types_config is keyed by :guild and :user (Discord's 0 and 1), and event_webhooks_status is :disabled, :enabled or :disabled_by_discord. flags holds the legacy flags; flags_new is the full bitfield, as a string.

Summary

Types

install_params()

@type install_params() :: %{scopes: [String.t()], permissions: String.t()}

t()

@type t() :: %Lingo.Type.Application{
  approximate_guild_count: integer() | nil,
  approximate_user_authorization_count: integer() | nil,
  approximate_user_install_count: integer() | nil,
  bot: Lingo.Type.User.t() | nil,
  bot_public: boolean(),
  bot_require_code_grant: boolean(),
  cover_image: String.t() | nil,
  custom_install_url: String.t() | nil,
  description: String.t(),
  event_webhooks_status:
    :disabled | :enabled | :disabled_by_discord | integer() | nil,
  event_webhooks_types: [String.t()],
  event_webhooks_url: String.t() | nil,
  flags: integer(),
  flags_new: String.t() | nil,
  guild: Lingo.Type.Guild.t() | nil,
  guild_id: String.t() | nil,
  icon: String.t() | nil,
  id: String.t(),
  install_params: install_params() | nil,
  integration_types_config:
    %{
      optional(:guild | :user) => %{
        oauth2_install_params: install_params() | nil
      }
    }
    | nil,
  interactions_endpoint_url: String.t() | nil,
  name: String.t(),
  owner: Lingo.Type.User.t() | nil,
  primary_sku_id: String.t() | nil,
  privacy_policy_url: String.t() | nil,
  redirect_uris: [String.t()],
  role_connections_verification_url: String.t() | nil,
  rpc_origins: [String.t()],
  slug: String.t() | nil,
  tags: [String.t()],
  team: team() | nil,
  terms_of_service_url: String.t() | nil,
  verify_key: String.t()
}

team()

@type team() :: %{
  id: String.t(),
  name: String.t(),
  icon: String.t() | nil,
  owner_user_id: String.t(),
  members: [team_member()]
}

team_member()

@type team_member() :: %{
  membership_state: :invited | :accepted | integer(),
  team_id: String.t(),
  user: Lingo.Type.User.t(),
  role: String.t()
}