mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 20:43:30 +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}`,
|
user: (userID) => `${API}/users/${userID}`,
|
||||||
userChannels: (userID) => `${Endpoints.user(userID)}/channels`,
|
userChannels: (userID) => `${Endpoints.user(userID)}/channels`,
|
||||||
userProfile: (userID) => `${Endpoints.user(userID)}/profile`,
|
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`,
|
me: `${API}/users/@me`,
|
||||||
meGuild: (guildID) => `${Endpoints.me}/guilds/${guildID}`,
|
meGuild: (guildID) => `${Endpoints.me}/guilds/${guildID}`,
|
||||||
meMentions: (limit, roles, everyone, guildID) =>
|
meMentions: (limit, roles, everyone, guildID) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user