From 752d1c9b1103c67a1d8ae55c54ae1705dd80df19 Mon Sep 17 00:00:00 2001 From: kmmiio99o Date: Thu, 7 May 2026 13:32:11 +0200 Subject: [PATCH] feat: remove messagefix was causing issues with freemoji plugin --- src/core/plugins/index.ts | 1 - src/core/plugins/messagefix/index.ts | 58 ---------------------------- 2 files changed, 59 deletions(-) delete mode 100644 src/core/plugins/messagefix/index.ts diff --git a/src/core/plugins/index.ts b/src/core/plugins/index.ts index 1545ea5..25f15cd 100644 --- a/src/core/plugins/index.ts +++ b/src/core/plugins/index.ts @@ -34,7 +34,6 @@ export const getCorePlugins = (): CorePluginRecord => ({ "bunny.quickinstall": makeLazyPlugin(() => require("./quickinstall"), true), "bunny.badges": makeLazyPlugin(() => require("./badges")), "bunny.notrack": makeLazyPlugin(() => require("./notrack")), - "bunny.messagefix": makeLazyPlugin(() => require("./messagefix")), "bunny.fixembed": makeLazyPlugin(() => require("./fixembed")), }); diff --git a/src/core/plugins/messagefix/index.ts b/src/core/plugins/messagefix/index.ts deleted file mode 100644 index 0efa77d..0000000 --- a/src/core/plugins/messagefix/index.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { defineCorePlugin } from ".."; -import { findByProps } from "@metro"; -import { logger } from "@lib/utils/logger"; - -// Find the MessageActions module -const MessageActions = findByProps("sendMessage"); -let originalSendMessage: Function; - -export default defineCorePlugin({ - manifest: { - id: "bunny.messagefix", - version: "1.0.0", - type: "plugin", - spec: 3, - main: "", - display: { - name: "MessageFix", - description: "Ensures messages include the required nonce parameter", - authors: [{ name: "Win8.1VMUser (plugin by ShiggyCord Team)" }], - }, - }, - - start() { - // Save original function - originalSendMessage = MessageActions.sendMessage; - - // Replace with our implementation - MessageActions.sendMessage = function ( - channelId: unknown, - message: unknown, - replyRef: unknown, - options: Record, - ) { - // Ensure options exists and has a nonce - options = options || {}; - if (!options.nonce) { - options.nonce = (BigInt(Date.now() - 1420070400000) << 22n).toString(); - } - - // Call original with fixed parameters - return (originalSendMessage as Function).call( - this, - channelId, - message, - replyRef, - options, - ); - }; - - logger.log("MessageFix: Enabled - adding nonce to all messages"); - }, - - stop() { - // Restore original function - if (originalSendMessage) MessageActions.sendMessage = originalSendMessage; - logger.log("MessageFix: Disabled"); - }, -});