mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
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:
@@ -133,8 +133,10 @@ exports.Endpoints = {
|
|||||||
},
|
},
|
||||||
Banner: (guildID, hash, format = 'webp', size) =>
|
Banner: (guildID, hash, format = 'webp', size) =>
|
||||||
makeImageUrl(`${root}/banners/${guildID}/${hash}`, { format, size }),
|
makeImageUrl(`${root}/banners/${guildID}/${hash}`, { format, size }),
|
||||||
Icon: (guildID, hash, format = 'webp', size) =>
|
Icon: (guildID, hash, format = 'default', size) => {
|
||||||
makeImageUrl(`${root}/icons/${guildID}/${hash}`, { format, size }),
|
if (format === 'default') format = hash.startsWith('a_') ? 'gif' : 'webp';
|
||||||
|
return makeImageUrl(`${root}/icons/${guildID}/${hash}`, { format, size });
|
||||||
|
},
|
||||||
AppIcon: (clientID, hash, { format = 'webp', size } = {}) =>
|
AppIcon: (clientID, hash, { format = 'webp', size } = {}) =>
|
||||||
makeImageUrl(`${root}/app-icons/${clientID}/${hash}`, { size, format }),
|
makeImageUrl(`${root}/app-icons/${clientID}/${hash}`, { size, format }),
|
||||||
AppAsset: (clientID, hash, { format = 'webp', size } = {}) =>
|
AppAsset: (clientID, hash, { format = 'webp', size } = {}) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user