feat(Guild): default iconURL to gif if animated (#3338)

* feat(Guild): default iconURL to gif if animated

* Icon, not Banner

* fix url
This commit is contained in:
SpaceEEC
2019-06-13 14:14:47 +02:00
committed by GitHub
parent f82f0af928
commit 1bec28bd81

View File

@@ -133,8 +133,10 @@ exports.Endpoints = {
},
Banner: (guildID, hash, format = 'webp', size) =>
makeImageUrl(`${root}/banners/${guildID}/${hash}`, { format, size }),
Icon: (guildID, hash, format = 'webp', size) =>
makeImageUrl(`${root}/icons/${guildID}/${hash}`, { format, size }),
Icon: (guildID, hash, format = 'default', size) => {
if (format === 'default') format = hash.startsWith('a_') ? 'gif' : 'webp';
return makeImageUrl(`${root}/icons/${guildID}/${hash}`, { format, size });
},
AppIcon: (clientID, hash, { format = 'webp', size } = {}) =>
makeImageUrl(`${root}/app-icons/${clientID}/${hash}`, { size, format }),
AppAsset: (clientID, hash, { format = 'webp', size } = {}) =>