diff --git a/manifest.json b/manifest.json index 1a39bb1..052879c 100644 --- a/manifest.json +++ b/manifest.json @@ -7,7 +7,7 @@ "discordID": "1000992611840049192", "github": "cafeed28" }, - "version": "1.0.6", + "version": "1.0.7", "updater": { "type": "github", "id": "cafeed28/replugged-nitrospoof" diff --git a/src/index.ts b/src/index.ts index ec56ef2..897a132 100644 --- a/src/index.ts +++ b/src/index.ts @@ -32,11 +32,12 @@ function replaceEmojis(message: OutgoingMessage): void { if (isEmojiAvailable(emoji)) continue; const name = emoji.originalName || emoji.name; - const animated = emoji.animated ? "a" : ""; - const searchString = `<${animated}:${name}:${emoji.id}>`; + const prefix = emoji.animated ? "a" : ""; + const searchString = `<${prefix}:${name}:${emoji.id}>`; const size = config.get("emojiSize", 48); - const replaceUrl = `https://cdn.discordapp.com/emojis/${emoji.id}?size=${size}`; // TODO: ui for this (when replugged settings ui is done) + const extension = emoji.animated ? "gif" : "webp"; + const replaceUrl = `https://cdn.discordapp.com/emojis/${emoji.id}.${extension}?size=${size}`; // TODO: ui for this (when replugged settings ui is done) message.content = message.content.replace(searchString, replaceUrl); }