View Source Nostrum.Struct.Sticker (Nostrum v0.10.0)

A Nostrum.Struct.Sticker represents a sticker that can be sent inside a Nostrum.Struct.Message.

Summary

Types

Whether this guild sticker can be used.

Description of the sticker

Format of the sticker.

ID of the guild that owns this sticker.

ID of the sticker

Name of the sticker

ID of the pack the sticker is from

The sticker's sort order within its pack.

t()

Tags used by the Discord client to auto-complete a sticker.

Whether the sticker is a standard (platform made) sticker or a custom guild sticker.

User that uploaded the guild sticker.

Functions

Fetch a CDN URL for the sticker object.

Types

Link to this type

available()

View Source (since 0.10.0)
@type available() :: boolean()

Whether this guild sticker can be used.

May be false due to loss of Server Boosts

Link to this type

description()

View Source (since 0.10.0)
@type description() :: String.t() | nil

Description of the sticker

Link to this type

format_type()

View Source (since 0.10.0)
@type format_type() :: :png | :apng | :lottie | :gif

Format of the sticker.

This field is used to determine the return URL in cdn_url/1.

Link to this type

guild_id()

View Source (since 0.10.0)
@type guild_id() :: Nostrum.Struct.Guild.id() | nil

ID of the guild that owns this sticker.

nil if the sticker is a built-in (type :standard) sticker.

@type id() :: Nostrum.Snowflake.t()

ID of the sticker

@type name() :: String.t() | nil

Name of the sticker

Link to this type

pack_id()

View Source (since 0.10.0)
@type pack_id() :: Nostrum.Snowflake.t()

ID of the pack the sticker is from

Link to this type

sort_value()

View Source (since 0.10.0)
@type sort_value() :: integer() | nil

The sticker's sort order within its pack.

Sometimes provided for stickers with type :standard that are in a pack.

@type t() :: %Nostrum.Struct.Sticker{
  available: available(),
  description: description(),
  format_type: format_type(),
  guild_id: guild_id(),
  id: id(),
  name: name(),
  pack_id: pack_id(),
  sort_value: sort_value(),
  tags: tags(),
  type: type(),
  user: user()
}
@type tags() :: String.t()

Tags used by the Discord client to auto-complete a sticker.

For default sticker packs, this is a comma-separated list. For guild stickers, this is the name of the unicode emoji associated by the sticker creator with the sticker.

This is technically a free-text field so consistency in formatting is not guaranteed.

@type type() :: :standard | :guild

Whether the sticker is a standard (platform made) sticker or a custom guild sticker.

@type user() :: Nostrum.Struct.User.t() | nil

User that uploaded the guild sticker.

nil if the sticker is a built-in (type :standard) sticker.

Functions

Link to this function

cdn_url(map)

View Source (since 0.10.0)
@spec cdn_url(t()) :: String.t()

Fetch a CDN URL for the sticker object.

:png and :apng stickers will return a .png URL, :gif will return a .gif URL and :lottie will return a .json URL.

Examples

iex> sticker = %Nostrum.Struct.Sticker{format_type: :gif, id: 112233445566778899}
iex> Nostrum.Struct.Sticker.cdn_url sticker
"https://media.discordapp.net/stickers/112233445566778899.gif"
iex> sticker = %Nostrum.Struct.Sticker{format_type: :apng, id: 998877665544332211}
iex> Nostrum.Struct.Sticker.cdn_url sticker
"https://cdn.discordapp.com/stickers/998877665544332211.png"