From 40b3ec57ce87752d7d2ed09f4fc36e423207ec7e Mon Sep 17 00:00:00 2001 From: sappho Date: Wed, 13 Dec 2023 04:37:31 -0500 Subject: [PATCH] FakeNitro: fix non apng gif stickers being sent as images (#2050) --- src/plugins/fakeNitro/index.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/fakeNitro/index.ts b/src/plugins/fakeNitro/index.ts index 957771887..6107df00e 100644 --- a/src/plugins/fakeNitro/index.ts +++ b/src/plugins/fakeNitro/index.ts @@ -787,7 +787,14 @@ export default definePlugin({ if (sticker.available !== false && (canUseStickers || sticker.guild_id === guildId)) break stickerBypass; - const link = this.getStickerLink(sticker.id); + // [12/12/2023] + // Work around an annoying bug where getStickerLink will return StickerType.GIF, + // but will give us a normal non animated png for no reason + // TODO: Remove this workaround when it's not needed anymore + let link = this.getStickerLink(sticker.id); + if (sticker.format_type === StickerType.GIF && link.includes(".png")) { + link = link.replace(".png", ".gif"); + } if (sticker.format_type === StickerType.APNG) { this.sendAnimatedSticker(link, sticker.id, channelId); return { cancel: true };