Crux vdev 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

Functions

Creates a Crux.Structs.Webhook struct from raw data

Converts a Crux.Structs.Webhook into its discord mention format

Link to this section Types

Link to this type

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

Link to this section Functions

Link to this function

create(data) View Source (since 0.1.6)

Creates a Crux.Structs.Webhook 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 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>"