mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 17:43:30 +01:00
refactor: change xID to xId (#6036)
* refactor: change `xID` to `xId` * Update src/managers/MessageManager.js Co-authored-by: Noel <buechler.noel@outlook.com> Co-authored-by: Noel <buechler.noel@outlook.com>
This commit is contained in:
@@ -24,7 +24,7 @@ class SnowflakeUtil extends null {
|
||||
|
||||
/**
|
||||
* Generates a Discord snowflake.
|
||||
* <info>This hardcodes the worker ID as 1 and the process ID as 0.</info>
|
||||
* <info>This hardcodes the worker's id as 1 and the process's id as 0.</info>
|
||||
* @param {number|Date} [timestamp=Date.now()] Timestamp or date of the snowflake to generate
|
||||
* @returns {Snowflake} The generated snowflake
|
||||
*/
|
||||
@@ -39,7 +39,7 @@ class SnowflakeUtil extends null {
|
||||
const BINARY = `${(timestamp - EPOCH).toString(2).padStart(42, '0')}0000100000${(INCREMENT++)
|
||||
.toString(2)
|
||||
.padStart(12, '0')}`;
|
||||
return Util.binaryToID(BINARY);
|
||||
return Util.binaryToId(BINARY);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,8 +47,8 @@ class SnowflakeUtil extends null {
|
||||
* @typedef {Object} DeconstructedSnowflake
|
||||
* @property {number} timestamp Timestamp the snowflake was created
|
||||
* @property {Date} date Date the snowflake was created
|
||||
* @property {number} workerID Worker ID in the snowflake
|
||||
* @property {number} processID Process ID in the snowflake
|
||||
* @property {number} workerId The worker's id in the snowflake
|
||||
* @property {number} processId The process's id in the snowflake
|
||||
* @property {number} increment Increment in the snowflake
|
||||
* @property {string} binary Binary representation of the snowflake
|
||||
*/
|
||||
@@ -65,8 +65,8 @@ class SnowflakeUtil extends null {
|
||||
get date() {
|
||||
return new Date(this.timestamp);
|
||||
},
|
||||
workerID: parseInt(BINARY.substring(42, 47), 2),
|
||||
processID: parseInt(BINARY.substring(47, 52), 2),
|
||||
workerId: parseInt(BINARY.substring(42, 47), 2),
|
||||
processId: parseInt(BINARY.substring(47, 52), 2),
|
||||
increment: parseInt(BINARY.substring(52, 64), 2),
|
||||
binary: BINARY,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user