mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
feat: add support for new username system (#3035)
* feat: add support for new username system * fix: default avatar calculation in avatarUrl(), also remove support for old system * fix: use description from docs for user.globalName * fix: typings * fix: avatarUrl() to support both old and new username system
This commit is contained in:
@@ -41,7 +41,7 @@ export function avatarUrl(
|
||||
options?.size ?? 128,
|
||||
options?.format,
|
||||
)
|
||||
: `https://cdn.discordapp.com/embed/avatars/${Number(discriminator) % 5}.png`
|
||||
: `https://cdn.discordapp.com/embed/avatars/${discriminator === '0' ? (BigInt(userId) >> BigInt(22)) % BigInt(6) : Number(discriminator) % 5}.png`
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user