From 745ad5c6c1c1c4f37c4ca391c8e8907b00ca5c4e Mon Sep 17 00:00:00 2001 From: Suanfanson <165536124+Suanfanson@users.noreply.github.com> Date: Sun, 31 Mar 2024 00:00:08 -0500 Subject: [PATCH] fix: avatarURL method (#171) --- src/structures/User.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/structures/User.ts b/src/structures/User.ts index 4629334..da8fe62 100644 --- a/src/structures/User.ts +++ b/src/structures/User.ts @@ -34,7 +34,8 @@ export class User extends DiscordBase { avatarURL(options?: ImageOptions) { if (!this.avatar) { - return this.rest.cdn.defaultAvatar(Number(this.discriminator)); + const avatarIndex = this.discriminator == '0' ? Number(BigInt(this.id) >> 22n) % 6 : this.discriminator % 5; + return this.rest.cdn.defaultAvatar(avatarIndex); } return this.rest.cdn.avatar(this.id, this.avatar, options); }