mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
Fix Avatar URL generation bug (#2063)
This commit is contained in:
@@ -114,6 +114,7 @@ exports.Endpoints = {
|
||||
Asset: name => `${root}/assets/${name}`,
|
||||
DefaultAvatar: number => `${root}/embed/avatars/${number}.png`,
|
||||
Avatar: (userID, hash, format = 'default', size) => {
|
||||
if (userID === '1') return hash;
|
||||
if (format === 'default') format = hash.startsWith('a_') ? 'gif' : 'webp';
|
||||
return makeImageUrl(`${root}/avatars/${userID}/${hash}`, { format, size });
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user