1.0.0 • Published 11 months ago

date-to-discord-snowflake v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

Description

Simple package used to generate a Discord snowflake from a Javascript Date.

Installation

Use the following command to install this package

npm install date-to-discord-snowflake

Usage

import generate from 'date-to-discord-snowflake';

// Define a date
const today = new Date();

// Generate snowflake
const snowflake = generate(today);

The generated snowflake can then be used with Discord API's /messages/search endpoint or any other related endpoints that use min_id, max_id, or similar params.