diff --git a/src/structures/user.ts b/src/structures/user.ts index c6d8bc0..1cd8843 100644 --- a/src/structures/user.ts +++ b/src/structures/user.ts @@ -40,16 +40,13 @@ export class User extends Base { return `<@${this.id}>` } - avatarURL(format?: ImageFormats, size?: ImageSize, dynamic: boolean = true) { - if (!format) format = 'webp' - if (!size) size = 512 - - return this.avatar + avatarURL(format: ImageFormats = 'webp', size: ImageSize = 512, dynamic: boolean = true): string { + return this.avatar != null ? `${ImageURL(USER_AVATAR(this.id, dynamic ? this.avatar : this.avatar.replace('a_', '')), format, size)}` : `${DEFAULT_USER_AVATAR(String(Number(this.discriminator) % 5))}.png` } - get defaultAvatarURL() { + get defaultAvatarURL(): string { return `${DEFAULT_USER_AVATAR(String(Number(this.discriminator) % 5))}.png` }