mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 17:43:30 +01:00
feat: support new username system (#9634)
* feat: support new username system (v13) * fix(User): check global name in equals * Update typings/index.d.ts Co-authored-by: Jaw0r3k <jaworekwiadomosci@gmail.com> * Update src/util/Util.js Co-authored-by: Jaw0r3k <jaworekwiadomosci@gmail.com> * typing * Update User.js * Update index.d.ts * Update User.js --------- Co-authored-by: Jaw0r3k <jaworekwiadomosci@gmail.com>
This commit is contained in:
@@ -741,6 +741,15 @@ class Util extends null {
|
||||
emoji_name: defaultReaction.name,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the default avatar index for a given user id.
|
||||
* @param {Snowflake} userId - The user id to calculate the default avatar index for
|
||||
* @returns {number}
|
||||
*/
|
||||
static calculateUserDefaultAvatarIndex(userId) {
|
||||
return Number(BigInt(userId) >> 22n) % 6;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Util;
|
||||
|
||||
Reference in New Issue
Block a user