mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
Fix User#avatarURL for Nitro animated avatars (#1012)
* fix avatar url * switch to cdn
This commit is contained in:
committed by
Schuyler Cebulskie
parent
f726db2152
commit
2390e525ef
@@ -90,7 +90,10 @@ const Endpoints = exports.Endpoints = {
|
||||
user: (userID) => `${API}/users/${userID}`,
|
||||
userChannels: (userID) => `${Endpoints.user(userID)}/channels`,
|
||||
userProfile: (userID) => `${Endpoints.user(userID)}/profile`,
|
||||
avatar: (userID, avatar) => userID === '1' ? avatar : `${Endpoints.user(userID)}/avatars/${avatar}.jpg`,
|
||||
avatar: (userID, avatar) => {
|
||||
if (userID === '1') return avatar;
|
||||
return `${Endpoints.CDN}/avatars/${userID}/${avatar}.${avatar.startsWith('a_') ? 'gif' : 'jpg'}`;
|
||||
},
|
||||
me: `${API}/users/@me`,
|
||||
meGuild: (guildID) => `${Endpoints.me}/guilds/${guildID}`,
|
||||
meMentions: (limit, roles, everyone, guildID) =>
|
||||
|
||||
Reference in New Issue
Block a user