Skip to content

Commit

Permalink
fix(freemoji): emoji.url isn't a thing anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
Rico040 committed May 5, 2024
1 parent 4d31f05 commit f3d7e50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/freemoji/src/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const sizeOptions = {
Jumbo: 128,
}

const previewUri = "https://cdn.discordapp.com/emojis/1105406110724268075.webp";
const previewUri = "https://cdn.discordapp.com/emojis/926602689213767680.webp";

export default () => {
useProxy(storage);
Expand Down
9 changes: 7 additions & 2 deletions plugins/freemoji/src/msgProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@ function extractUnusableEmojis(messageString: string, size: number) {
// Remove emote from original msg
messageString = messageString.replace(emojiString[0], "");
// Add to emotes to send
emojiUrls.push(`${emoji.url.split("?")[0]}?size=${size}`);
// Hacky fix, someone on discord removed url property for emoji
if (emoji.animated){
emojiUrls.push(`https://cdn.discordapp.com/emojis/${emojiString[2]}.gif?size=${size}`);
} else {
emojiUrls.push(`https://cdn.discordapp.com/emojis/${emojiString[2]}.webp?size=${size}`);
}
}
}

return {
newContent: messageString.trim(),
extractedEmojis: emojiUrls,
Expand Down

0 comments on commit f3d7e50

Please sign in to comment.