Liking cljdoc? Tell your friends :D

discljord.snowflakes

Contains utility functions to parse, deconstruct and create snowflake ids.

Contains utility functions to parse, deconstruct and create [snowflake ids](https://discord.com/developers/docs/reference#snowflakes).
raw docstring

discord-epochclj

The Discord epoch - the number of milliseconds that had passed since January 1, 1970, on January 1, 2015.

The Discord epoch - the number of milliseconds that had passed since January 1, 1970, on January 1, 2015.
sourceraw docstring

incrementclj

(increment snowflake)

Returns the increment of this id, i.e. the number of ids that had been generated before on its process.

Takes either a string or a number representing the snowflake.

Returns the increment of this id, i.e. the number of ids that had been generated before on its process.

Takes either a string or a number representing the snowflake.
sourceraw docstring

internal-process-idclj

(internal-process-id snowflake)

Returns the internal id of the process this id was generated on.

Takes either a string or a number representing the snowflake.

Returns the internal id of the process this id was generated on.

Takes either a string or a number representing the snowflake.
sourceraw docstring

internal-worker-idclj

(internal-worker-id snowflake)

Returns the internal id of the worker that generated this id.

Takes either a string or a number representing the snowflake.

Returns the internal id of the worker that generated this id.

Takes either a string or a number representing the snowflake.
sourceraw docstring

parse-snowflakeclj

(parse-snowflake snowflake)

Extracts all information from the given id and returns it as a map.

The map has the following keys: :id - The input snowflake as a number :timestamp - See timestamp :internal-worker-id - See internal-worker-id :internal-process-id - See internal-process-id :increment - See increment

Extracts all information from the given id and returns it as a map.

The map has the following keys:
`:id` - The input snowflake as a number
`:timestamp` - See [[timestamp]]
`:internal-worker-id` - See [[internal-worker-id]]
`:internal-process-id` - See [[internal-process-id]]
`:increment` - See [[increment]]
sourceraw docstring

timestampclj

(timestamp snowflake)

Returns the UNIX timestamp (ms) for when this id was generated.

Takes either a string or a number representing the snowflake.

Returns the UNIX timestamp (ms) for when this id was generated.

Takes either a string or a number representing the snowflake.
sourceraw docstring

timestamp->snowflakeclj

(timestamp->snowflake timestamp)

Takes a UNIX milliseconds timestamp (like from (System/currentTimeMillis)) and returns it as a Discord snowflake id.

This can be used for paginated endpoints where ids are used to represent bounds like 'before' and 'after' to get results before, after or between timestamps.

Takes a UNIX milliseconds timestamp (like from `(System/currentTimeMillis)`) and returns it as a Discord snowflake id.

This can be used for paginated endpoints where ids are used to represent bounds like
'before' and 'after' to get results before, after or between timestamps.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close