From 7353ee0681d95805ec47956154bbd36d9a832e8d Mon Sep 17 00:00:00 2001 From: cafeed28 Date: Wed, 28 Dec 2022 00:22:22 +0500 Subject: [PATCH] lol i forgot file extension --- manifest.json | 2 +- src/index.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) 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); }