From f1c5709ce9d9d8b843f7dcef536fc4eeb28cba1a Mon Sep 17 00:00:00 2001 From: amsyarasyiq <82711525+amsyarasyiq@users.noreply.github.com> Date: Sun, 27 Aug 2023 14:04:38 +0800 Subject: [PATCH] Fix HoldGIFSend --- plugins/HoldGIFSend/src/index.ts | 9 ++++++++- plugins/NoAutoReplyMention/src/index.ts | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/HoldGIFSend/src/index.ts b/plugins/HoldGIFSend/src/index.ts index aa17f2f..9858c92 100644 --- a/plugins/HoldGIFSend/src/index.ts +++ b/plugins/HoldGIFSend/src/index.ts @@ -3,4 +3,11 @@ import { instead } from "@vendetta/patcher"; const messageInputUtil = findByProps("selectGIF"); -export const onUnload = instead("selectGIF", messageInputUtil, ([{ url }]) => messageInputUtil.insertText(url)); +export const onUnload = instead("selectGIF", messageInputUtil, (args) => { + // args[1] never exists on older version, so we use it as an indicator + // prev: selectGIF([GIF]) now: selectGIF(currentChannelId, [GIF]); + if (args[1]) args[1] = args[1].url; + else args[0] = args[0].url; + + messageInputUtil.insertText(...args); +}); diff --git a/plugins/NoAutoReplyMention/src/index.ts b/plugins/NoAutoReplyMention/src/index.ts index f8607c4..d34a9c4 100644 --- a/plugins/NoAutoReplyMention/src/index.ts +++ b/plugins/NoAutoReplyMention/src/index.ts @@ -13,6 +13,8 @@ export interface SettingsSchema { storage.isBlacklistMode ??= false; storage.exempted ??= []; +export const settings = storage as SettingsSchema; + const ReplyManager = findByProps("createPendingReply"); export default {