Fix webp animated emojis
https://discord.com/developers/docs/reference#image-formatting-cdn-endpoints > WebP and AVIF formats must be requested as WebP.
This commit is contained in:
@@ -24,7 +24,7 @@ async function emojisToState(emojis) {
|
||||
file.uploadDiscordFileToMxc(file.emoji(emoji.id, emoji.animated)).then(url => {
|
||||
result.images[emoji.name] = {
|
||||
info: {
|
||||
mimetype: emoji.animated ? "image/gif" : "image/png"
|
||||
mimetype: "image/webp"
|
||||
},
|
||||
url
|
||||
}
|
||||
|
||||
@@ -103,9 +103,9 @@ function memberAvatar(guildID, user, member) {
|
||||
}
|
||||
|
||||
function emoji(emojiID, animated) {
|
||||
const base = `/emojis/${emojiID}`
|
||||
if (animated) return base + ".gif"
|
||||
else return base + ".png"
|
||||
const base = `/emojis/${emojiID}.webp`
|
||||
if (animated) return base + "?animated=true"
|
||||
else return base
|
||||
}
|
||||
|
||||
const stickerFormat = new Map([
|
||||
|
||||
Reference in New Issue
Block a user