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