Fix HoldGIFSend

This commit is contained in:
amsyarasyiq 2023-08-27 14:04:38 +08:00
parent b36ff42d59
commit f1c5709ce9
2 changed files with 10 additions and 1 deletions

View file

@ -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);
});

View file

@ -13,6 +13,8 @@ export interface SettingsSchema {
storage.isBlacklistMode ??= false;
storage.exempted ??= [];
export const settings = storage as SettingsSchema;
const ReplyManager = findByProps("createPendingReply");
export default {