Skip to content

Commit

Permalink
feat(Guild): default iconURL to gif if animated (#3338)
Browse files Browse the repository at this point in the history
* feat(Guild): default iconURL to gif if animated

* Icon, not Banner

* fix url
  • Loading branch information
SpaceEEC committed Jun 13, 2019
1 parent f82f0af commit 1bec28b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/util/Constants.js
Expand Up @@ -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 } = {}) =>
Expand Down

0 comments on commit 1bec28b

Please sign in to comment.