From 4c9908c64794038d49f797acf9e2893829ab4530 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Sun, 1 Dec 2024 20:49:54 -0500 Subject: [PATCH] feat(plugins): Remove ChatBar Button Properly --- src/equicordplugins/encryptcord/index.tsx | 5 ++--- src/equicordplugins/meow/index.tsx | 7 +++---- src/equicordplugins/woof/index.tsx | 7 +++---- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/equicordplugins/encryptcord/index.tsx b/src/equicordplugins/encryptcord/index.tsx index b59032c3..49d37500 100644 --- a/src/equicordplugins/encryptcord/index.tsx +++ b/src/equicordplugins/encryptcord/index.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { addChatBarButton, ChatBarButton } from "@api/ChatButtons"; +import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons"; import { ApplicationCommandInputType, ApplicationCommandOptionType, @@ -12,7 +12,6 @@ import { } from "@api/Commands"; import * as DataStore from "@api/DataStore"; import { addPreSendListener, removePreSendListener, SendListener } from "@api/MessageEvents"; -import { removeButton } from "@api/MessagePopover"; import { Devs } from "@utils/constants"; import { sleep } from "@utils/misc"; import definePlugin from "@utils/types"; @@ -273,7 +272,7 @@ export default definePlugin({ await DataStore.set("encryptcordGroupMembers", {}); }, async stop() { - removeButton("Encryptcord"); + removeChatBarButton("Encryptcord"); if (await DataStore.get("encryptcordGroup") === true) { await leave("", { channel: { id: await DataStore.get("encryptcordChannelId") } }); } diff --git a/src/equicordplugins/meow/index.tsx b/src/equicordplugins/meow/index.tsx index 8a770ad7..adf7831d 100644 --- a/src/equicordplugins/meow/index.tsx +++ b/src/equicordplugins/meow/index.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { addChatBarButton, ChatBarButton } from "@api/ChatButtons"; +import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons"; import { Devs } from "@utils/constants"; import { getCurrentChannel, sendMessage } from "@utils/discord"; import definePlugin from "@utils/types"; @@ -27,7 +27,6 @@ export default definePlugin({ description: "Adds a chatbar button to meow in chat", authors: [Devs.Samwich], - start() { - addChatBarButton("vc-meow", ChatBarIcon); - } + start: () => addChatBarButton("Meow", ChatBarIcon), + stop: () => removeChatBarButton("Meow") }); diff --git a/src/equicordplugins/woof/index.tsx b/src/equicordplugins/woof/index.tsx index 29cb6afe..f55f840b 100644 --- a/src/equicordplugins/woof/index.tsx +++ b/src/equicordplugins/woof/index.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { addChatBarButton, ChatBarButton } from "@api/ChatButtons"; +import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons"; import { Devs } from "@utils/constants"; import { getCurrentChannel, sendMessage } from "@utils/discord"; import definePlugin from "@utils/types"; @@ -26,7 +26,6 @@ export default definePlugin({ name: "Woof", description: "Adds a chatbar button to woof in chat", authors: [Devs.Samwich], - start() { - addChatBarButton("vc-woof", ChatBarIcon); - } + start: () => addChatBarButton("Woof", ChatBarIcon), + stop: () => removeChatBarButton("Woof") });