This commit is contained in:
minibox24 2020-12-03 12:03:17 +09:00
parent cdd874275e
commit 45eadb5d11

View file

@ -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`
}