mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-03 13:36:08 +00:00
14 lines
346 B
TypeScript
14 lines
346 B
TypeScript
/** snowflake type */
|
|
export type Snowflake = string;
|
|
|
|
/** Discord epoch */
|
|
export const DiscordEpoch = 14200704e5;
|
|
|
|
/** utilities for Snowflakes */
|
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
export const Snowflake = {
|
|
snowflakeToTimestamp(id: Snowflake): number {
|
|
return (Number(id) >> 22) + DiscordEpoch;
|
|
},
|
|
};
|