From 83bf82cec9bc35f7d28be57f290ade300f33d870 Mon Sep 17 00:00:00 2001 From: ukrioo <80760888+ukrioo@users.noreply.github.com> Date: Thu, 14 Dec 2023 11:52:41 +0530 Subject: [PATCH] test --- vendetta/HideChatButtons/manifest.json | 7 +++++++ vendetta/HideChatButtons/src/index.ts | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 vendetta/HideChatButtons/manifest.json create mode 100644 vendetta/HideChatButtons/src/index.ts diff --git a/vendetta/HideChatButtons/manifest.json b/vendetta/HideChatButtons/manifest.json new file mode 100644 index 0000000..0c403c6 --- /dev/null +++ b/vendetta/HideChatButtons/manifest.json @@ -0,0 +1,7 @@ +{ + "name": "HideChatButtons", + "description": "Hides the gift and thread buttons in the chat input.", + "vendetta": { + "icon": "ThreadIcon" + } +} \ No newline at end of file diff --git a/vendetta/HideChatButtons/src/index.ts b/vendetta/HideChatButtons/src/index.ts new file mode 100644 index 0000000..e9b4a88 --- /dev/null +++ b/vendetta/HideChatButtons/src/index.ts @@ -0,0 +1,19 @@ +import { findByName } from "@vendetta/metro"; +import { after } from "@vendetta/patcher"; +import { getAssetIDByName } from "@vendetta/ui/assets"; +import { findInReactTree } from "@vendetta/utils"; + +const ChatInput = findByName("ChatInput"); + +let unpatch: () => boolean; + +export default { + onLoad() { + const blockList = ["ic_thread_normal_24px", "ic_gift", "ThreadIcon"].map(n => getAssetIDByName(n)); + unpatch = after("render", ChatInput.prototype, (_, ret) => { + const input = findInReactTree(ret, t => "forceAnimateButtons" in t.props && t.props.actions); + input.props.actions = input.props.actions.filter(a => !blockList.includes(a.source)); + }); + }, + onUnload: unpatch +}; \ No newline at end of file