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:
Antonio Román
2021-07-04 20:54:27 +02:00
committed by GitHub
parent 281072be44
commit a7c6678c72
95 changed files with 963 additions and 963 deletions

View File

@@ -42,31 +42,31 @@ function makeImageUrl(root, { format = 'webp', size } = {}) {
exports.Endpoints = {
CDN(root) {
return {
Emoji: (emojiID, format = 'png') => `${root}/emojis/${emojiID}.${format}`,
Emoji: (emojiId, format = 'png') => `${root}/emojis/${emojiId}.${format}`,
Asset: name => `${root}/assets/${name}`,
DefaultAvatar: discriminator => `${root}/embed/avatars/${discriminator}.png`,
Avatar: (userID, hash, format = 'webp', size, dynamic = false) => {
Avatar: (userId, hash, format = 'webp', size, dynamic = false) => {
if (dynamic) format = hash.startsWith('a_') ? 'gif' : format;
return makeImageUrl(`${root}/avatars/${userID}/${hash}`, { format, size });
return makeImageUrl(`${root}/avatars/${userId}/${hash}`, { format, size });
},
Banner: (guildID, hash, format = 'webp', size) =>
makeImageUrl(`${root}/banners/${guildID}/${hash}`, { format, size }),
Icon: (guildID, hash, format = 'webp', size, dynamic = false) => {
Banner: (guildId, hash, format = 'webp', size) =>
makeImageUrl(`${root}/banners/${guildId}/${hash}`, { format, size }),
Icon: (guildId, hash, format = 'webp', size, dynamic = false) => {
if (dynamic) format = hash.startsWith('a_') ? 'gif' : format;
return makeImageUrl(`${root}/icons/${guildID}/${hash}`, { format, size });
return makeImageUrl(`${root}/icons/${guildId}/${hash}`, { format, size });
},
AppIcon: (clientID, hash, { format = 'webp', size } = {}) =>
makeImageUrl(`${root}/app-icons/${clientID}/${hash}`, { size, format }),
AppAsset: (clientID, hash, { format = 'webp', size } = {}) =>
makeImageUrl(`${root}/app-assets/${clientID}/${hash}`, { size, format }),
GDMIcon: (channelID, hash, format = 'webp', size) =>
makeImageUrl(`${root}/channel-icons/${channelID}/${hash}`, { size, format }),
Splash: (guildID, hash, format = 'webp', size) =>
makeImageUrl(`${root}/splashes/${guildID}/${hash}`, { size, format }),
DiscoverySplash: (guildID, hash, format = 'webp', size) =>
makeImageUrl(`${root}/discovery-splashes/${guildID}/${hash}`, { size, format }),
TeamIcon: (teamID, hash, { format = 'webp', size } = {}) =>
makeImageUrl(`${root}/team-icons/${teamID}/${hash}`, { size, format }),
AppIcon: (clientId, hash, { format = 'webp', size } = {}) =>
makeImageUrl(`${root}/app-icons/${clientId}/${hash}`, { size, format }),
AppAsset: (clientId, hash, { format = 'webp', size } = {}) =>
makeImageUrl(`${root}/app-assets/${clientId}/${hash}`, { size, format }),
GDMIcon: (channelId, hash, format = 'webp', size) =>
makeImageUrl(`${root}/channel-icons/${channelId}/${hash}`, { size, format }),
Splash: (guildId, hash, format = 'webp', size) =>
makeImageUrl(`${root}/splashes/${guildId}/${hash}`, { size, format }),
DiscoverySplash: (guildId, hash, format = 'webp', size) =>
makeImageUrl(`${root}/discovery-splashes/${guildId}/${hash}`, { size, format }),
TeamIcon: (teamId, hash, { format = 'webp', size } = {}) =>
makeImageUrl(`${root}/team-icons/${teamId}/${hash}`, { size, format }),
};
},
invite: (root, code) => `${root}/${code}`,

View File

@@ -28,7 +28,7 @@
/**
* Options for a client.
* @typedef {Object} ClientOptions
* @property {number|number[]|string} [shards] ID of the shard to run, or an array of shard IDs. If not specified,
* @property {number|number[]|string} [shards] The shard's id to run, or an array of shard ids. If not specified,
* the client will spawn {@link ClientOptions#shardCount} shards. If set to `auto`, it will fetch the
* recommended amount of shards from Discord and spawn that amount
* @property {number} [shardCount=1] The total amount of shards used by all processes of this bot

View File

@@ -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,
};

View File

@@ -277,8 +277,8 @@ class Util extends null {
/**
* Parses emoji info out of a string. The string must be one of:
* * A UTF-8 emoji (no ID)
* * A URL-encoded UTF-8 emoji (no ID)
* * A UTF-8 emoji (no id)
* * A URL-encoded UTF-8 emoji (no id)
* * A Discord custom emoji (`<:name:id>` or `<a:name:id>`)
* @param {string} text Emoji string to parse
* @returns {APIEmoji} Object with `animated`, `name`, and `id` properties
@@ -469,7 +469,7 @@ class Util extends null {
}
/**
* Sorts by Discord's position and ID.
* Sorts by Discord's position and id.
* @param {Collection} collection Collection of objects to sort
* @returns {Collection}
*/
@@ -539,7 +539,7 @@ class Util extends null {
* @returns {Snowflake}
* @private
*/
static binaryToID(num) {
static binaryToId(num) {
let dec = '';
while (num.length > 50) {