fix: Ensure discriminator detection respects webhooks too

#11062 djs
This commit is contained in:
Elysia
2025-10-11 17:13:27 +07:00
parent 4d4fa1b17d
commit d9d11bd6b7

View File

@@ -310,7 +310,10 @@ class User extends Base {
* @readonly * @readonly
*/ */
get defaultAvatarURL() { get defaultAvatarURL() {
const index = this.discriminator === '0' ? Util.calculateUserDefaultAvatarIndex(this.id) : this.discriminator % 5; const index =
this.discriminator === '0' || this.discriminator === '0000'
? Util.calculateUserDefaultAvatarIndex(this.id)
: this.discriminator % 5;
return this.client.rest.cdn.DefaultAvatar(index); return this.client.rest.cdn.DefaultAvatar(index);
} }
@@ -357,7 +360,7 @@ class User extends Base {
*/ */
get tag() { get tag() {
return typeof this.username === 'string' return typeof this.username === 'string'
? this.discriminator === '0' ? this.discriminator === '0' || this.discriminator === '0000'
? this.username ? this.username
: `${this.username}#${this.discriminator}` : `${this.username}#${this.discriminator}`
: null; : null;