feat: migrate to the new system.

This commit is contained in:
Hexagonn
2024-10-20 19:44:03 +07:00
parent ff86f2afde
commit be11864c21
68 changed files with 1293 additions and 2752 deletions

9
old/src/snowflake.ts Normal file
View File

@@ -0,0 +1,9 @@
const EPOCH = 1420070400000; // Discord's EPOCH
// Snowflakes will never be a string
export function isSnowflake(snowflake: number | string): boolean {
snowflake = Number(snowflake);
return (
Number.isInteger(+snowflake) && snowflake > 4194304 && !isNaN(new Date(snowflake / 4194304 + EPOCH).getTime())
);
}