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:
Elysia
2023-07-09 00:01:01 +07:00
committed by GitHub
parent 85338ef073
commit f9e9843a92
5 changed files with 50 additions and 8 deletions

View File

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