diff --git a/discord.master.js b/discord.master.js index 43eb8754..dc11164e 100644 --- a/discord.master.js +++ b/discord.master.js @@ -13201,20 +13201,10 @@ const Long = __webpack_require__(44); const EPOCH = 1420070400000; let INCREMENT = 0; -function pad(v, n, c = '0') { - return String(v).length >= n ? String(v) : (String(c).repeat(n) + v).slice(-n); -} - - /** - * A deconstructed snowflake - * @typedef {Object} DeconstructedSnowflake - * @property {Date} date Date in the snowflake - * @property {number} workerID Worker id in the snowflake - * @property {number} processID Process id in the snowflake - * @property {number} increment Increment in the snowflake - * @property {string} binary Binary representation of the snowflake - */ - +/** + * A container for useful snowflake-related methods + */ +class Snowflake { /** * A Twitter snowflake, except the epoch is 2015-01-01T00:00:00.000Z * ``` @@ -13226,9 +13216,8 @@ function pad(v, n, c = '0') { * ``` * Note: this generator hardcodes the worker id as 1 and the process id as 0 * @typedef {string} Snowflake - * @class Snowflake */ -class Snowflake { + /** * Generate a Discord snowflake * @returns {Snowflake} The generated snowflake @@ -13239,6 +13228,16 @@ class Snowflake { return Long.fromString(BINARY, 2).toString(); } + /** + * A deconstructed snowflake + * @typedef {Object} DeconstructedSnowflake + * @property {Date} date Date in the snowflake + * @property {number} workerID Worker id in the snowflake + * @property {number} processID Process id in the snowflake + * @property {number} increment Increment in the snowflake + * @property {string} binary Binary representation of the snowflake + */ + /** * Deconstruct a Discord snowflake * @param {Snowflake} snowflake Snowflake to deconstruct @@ -13256,6 +13255,10 @@ class Snowflake { } } +function pad(v, n, c = '0') { + return String(v).length >= n ? String(v) : (String(c).repeat(n) + v).slice(-n); +} + module.exports = Snowflake;