Skip to content

isSnowflake

isSnowflake(value): boolean

Defined in: packages/utils/src/index.ts:17

Tests whether a value looks like a Discord snowflake: 16 to 20 digits. A snowflake is an unsigned 64-bit number, so it never has more than 20 digits; the minimum keeps short numbers in text from being read as IDs. (Routes only validates IDs it is given, so it accepts 1 to 20 digits.)

string

boolean