Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SnowflakeUtil

Utility class for working with Snowflakes

Hierarchy

  • any
    • SnowflakeUtil

Index

Constructors

Methods

  • deconstruct(id: string | bigint): number
  • Deconstructs a Discord snowflake

    example
    const timestamp = SnowflakeUtil.deconstruct('934675087108481044');
    

    Parameters

    • id: string | bigint

      The snowflake to deconstruct

    Returns number

  • generate(timestamp?: number): string
  • Generates a Discord snowflake

    Parameters

    • timestamp: number = ...

      Timestamp of the snowflake to generate

    Returns string

Generated using TypeDoc version 0.22.16, the 9/16/2022 at 1:09:15 AM