Crux v2020-03-17 17:55:51Z Crux.Structs.Webhook View Source

Represents a Discord Webhook Object

Differences opposed to the Discord API Object:

  • :user is just the user id

Link to this section Summary

Types

All available types that can be resolved into a webhook id.

t()

Functions

Creates a Crux.Structs.Webhook.t/0 struct from raw data.

Converts a Crux.Structs.Webhook.t/0 into its discord mention format.

Link to this section Types

Link to this type

id_resolvable() View Source (since 0.2.1)

All available types that can be resolved into a webhook id.

Link to this type

t() View Source (since 0.1.6)
t() :: %Crux.Structs.Webhook{
  avatar: String.t() | nil,
  channel_id: Crux.Structs.Snowflake.t(),
  guild_id: Crux.Structs.Snowflake.t() | nil,
  id: Crux.Structs.Snowflake.t(),
  name: String.t() | nil,
  token: String.t() | nil,
  type: non_neg_integer(),
  user: Crux.Structs.Snowflake.t() | nil
}

Link to this section Functions

Link to this function

create(data) View Source (since 0.1.6)
create(data :: map()) :: t()

Creates a Crux.Structs.Webhook.t/0 struct from raw data.

Automatically invoked by Crux.Structs.create/2.

Link to this function

to_mention(webhook) View Source (since 0.1.6)
to_mention(webhook :: Crux.Structs.Webhook.t()) :: String.t()

Converts a Crux.Structs.Webhook.t/0 into its discord mention format.

Although the discord client does not autocomplete it for you, mentioning one still works.

iex> %Crux.Structs.Webhook{id: 218348062828003328}
...> |> Crux.Structs.Webhook.to_mention()
"<@218348062828003328>"