Lingo.Snowflake (Lingo v0.4.2)

Copy Markdown View Source

Discord ids ("snowflakes"). Lingo keeps them as strings, as Discord sends them; they encode their creation time.

Summary

Functions

The smallest id created at datetime, for before:/after: pagination.

The smallest id created at a Unix time in milliseconds.

When the object with this id was created.

The id as an integer.

Types

t()

@type t() :: String.t()

Functions

from_datetime(dt)

@spec from_datetime(DateTime.t()) :: t()

The smallest id created at datetime, for before:/after: pagination.

from_unix_ms(ms)

@spec from_unix_ms(integer()) :: t()

The smallest id created at a Unix time in milliseconds.

to_datetime(snowflake)

@spec to_datetime(t()) :: DateTime.t()

When the object with this id was created.

to_integer(snowflake)

@spec to_integer(t()) :: non_neg_integer()

The id as an integer.