discord_gleam/discord/snowflake

Snowflakes is discord’s type for unique identifiers.
They are 64-bit unsigned integers, represented as strings.
See https://discord.com/developers/docs/reference#snowflakes

Types

pub type Application
pub type Attachment
pub type Channel
pub type Emoji
pub type Guild
pub type Interaction
pub type Message
pub type Role
pub type Sku

We are representing Discord’s snowflake as a string

pub opaque type Snowflake(kind)
pub type User
pub type Webhook

Values

pub fn coerce(s: Snowflake(a)) -> Snowflake(b)
pub fn compare(
  a: Snowflake(kind),
  b: Snowflake(kind),
) -> order.Order
pub fn decoder() -> decode.Decoder(Snowflake(kind))

API should not give a int, but incase it does we will convert to string.

pub fn from_string(value: String) -> Snowflake(kind)
pub fn to_string(snowflake: Snowflake(kind)) -> String
Search Document