crux_structs v0.2.3 Crux.Structs.Webhook View Source
Represents a Discord Webhook Object
Differences opposed to the Discord API Object:
:useris just the user id
Link to this section Summary
Functions
Creates a t:Crux.Structs.Webhook.t/0 struct from raw data.
Converts a t:Crux.Structs.Webhook.t/0 into its discord mention format.
Link to this section Types
Specs
id_resolvable() :: Crux.Structs.Webhook.t() | Crux.Structs.Snowflake.t() | String.t()
All available types that can be resolved into a webhook id.
Specs
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
Specs
Creates a t:Crux.Structs.Webhook.t/0 struct from raw data.
Automatically invoked by
Crux.Structs.create/2.
Specs
to_mention(webhook :: Crux.Structs.Webhook.t()) :: String.t()
Converts a t: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>"