mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-02 04:56:07 +00:00
13 lines
278 B
TypeScript
13 lines
278 B
TypeScript
/** snowflake type */
|
|
export type Snowflake = string;
|
|
|
|
/** Discord epoch */
|
|
export const DiscordEpoch = 14200704e5;
|
|
|
|
/** utilities for Snowflakes */
|
|
export const Snowflake = {
|
|
snowflakeToTimestamp(id: Snowflake) {
|
|
return (Number(id) >> 22) + DiscordEpoch;
|
|
},
|
|
};
|