From 45eadb5d11113abf6b0090d08cdf6cf6d2b80116 Mon Sep 17 00:00:00 2001 From: minibox24 Date: Thu, 3 Dec 2020 12:03:17 +0900 Subject: [PATCH] linting --- src/structures/user.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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` }