mirror of
https://github.com/NohamR/lanyard-profile-readme.git
synced 2026-05-26 04:17:19 +00:00
feat: migrate to the new system.
This commit is contained in:
9
old/src/snowflake.ts
Normal file
9
old/src/snowflake.ts
Normal 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())
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user