From 149fc67090bf17117dc73b6ab5845b11a7b2e8dc Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Wed, 22 Jan 2025 22:51:34 -0500 Subject: [PATCH] More Fixes --- src/equicordplugins/encryptcord/index.tsx | 8 ++++---- src/equicordplugins/furudoSpeak.dev/index.tsx | 8 ++++---- src/equicordplugins/meow/index.tsx | 4 ++-- src/equicordplugins/polishWording/index.ts | 4 ++-- src/equicordplugins/sekaiStickers/index.tsx | 4 ++-- src/equicordplugins/shakeSpearean.dev/index.ts | 4 ++-- src/equicordplugins/signature/index.tsx | 4 ++-- src/equicordplugins/woof/index.tsx | 4 ++-- src/utils/types.ts | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/equicordplugins/encryptcord/index.tsx b/src/equicordplugins/encryptcord/index.tsx index 53177b3a..eef5628e 100644 --- a/src/equicordplugins/encryptcord/index.tsx +++ b/src/equicordplugins/encryptcord/index.tsx @@ -4,14 +4,14 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons"; +import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons"; import { ApplicationCommandInputType, ApplicationCommandOptionType, sendBotMessage, } from "@api/Commands"; import * as DataStore from "@api/DataStore"; -import { addMessagePreSendListener, removeMessagePreSendListener, SendListener } from "@api/MessageEvents"; +import { addMessagePreSendListener, MessageSendListener, removeMessagePreSendListener } from "@api/MessageEvents"; import { Devs } from "@utils/constants"; import { sleep } from "@utils/misc"; import definePlugin from "@utils/types"; @@ -41,12 +41,12 @@ interface IMessageCreate { message: Message; } -const ChatBarIcon: ChatBarButton = ({ isMainChat }) => { +const ChatBarIcon: ChatBarButtonFactory = ({ isMainChat }) => { [enabled, setEnabled] = useState(false); const [buttonDisabled, setButtonDisabled] = useState(false); useEffect(() => { - const listener: SendListener = async (_, message) => { + const listener: MessageSendListener = async (_, message) => { if (enabled) { const groupChannel = await DataStore.get("encryptcordChannelId"); // @ts-expect-error typing issue diff --git a/src/equicordplugins/furudoSpeak.dev/index.tsx b/src/equicordplugins/furudoSpeak.dev/index.tsx index 04f4dd94..cc4f03a8 100644 --- a/src/equicordplugins/furudoSpeak.dev/index.tsx +++ b/src/equicordplugins/furudoSpeak.dev/index.tsx @@ -4,10 +4,10 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons"; +import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons"; import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from "@api/Commands"; import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu"; -import { addMessagePreSendListener, removeMessagePreSendListener, SendListener } from "@api/MessageEvents"; +import { addMessagePreSendListener, MessageSendListener, removeMessagePreSendListener } from "@api/MessageEvents"; import { definePluginSettings, Settings } from "@api/Settings"; import { ErrorCard } from "@components/ErrorCard"; import { Link } from "@components/Link"; @@ -103,7 +103,7 @@ function messageSendListenerFuncs() { } -const FurudoSpeakChatToggle: ChatBarButton = ({ isMainChat }) => { +const FurudoSpeakChatToggle: ChatBarButtonFactory = ({ isMainChat }) => { const { isEnabled, showIcon } = furudosettings.use(["isEnabled", "showIcon"]); const toggle = async () => { const done = await togglefunc(); @@ -160,7 +160,7 @@ const ChatBarContextCheckbox: NavContextMenuPatchCallback = children => { }; -const presendObject: SendListener = async (channelId, msg, extra) => { +const presendObject: MessageSendListener = async (channelId, msg, extra) => { const messageRef = extra.replyOptions.messageReference; const repliedMessage = ((messageRef?.message_id && messageRef.channel_id) && MessageStore.getMessage(messageRef?.channel_id, messageRef?.message_id)) || undefined; const apikey = Settings.plugins.FurudoSpeak.apiKey || ""; diff --git a/src/equicordplugins/meow/index.tsx b/src/equicordplugins/meow/index.tsx index adf7831d..f6a5020a 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, removeChatBarButton } from "@api/ChatButtons"; +import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons"; import { Devs } from "@utils/constants"; import { getCurrentChannel, sendMessage } from "@utils/discord"; import definePlugin from "@utils/types"; @@ -14,7 +14,7 @@ async function handleButtonClick() { sendMessage(getCurrentChannel().id, { content: "meow" }); } -const ChatBarIcon: ChatBarButton = () => { +const ChatBarIcon: ChatBarButtonFactory = () => { return ( diff --git a/src/equicordplugins/polishWording/index.ts b/src/equicordplugins/polishWording/index.ts index 8f08c4c4..7f683588 100644 --- a/src/equicordplugins/polishWording/index.ts +++ b/src/equicordplugins/polishWording/index.ts @@ -6,8 +6,8 @@ import { addMessagePreSendListener, + MessageSendListener, removeMessagePreSendListener, - SendListener, } from "@api/MessageEvents"; import { definePluginSettings, @@ -17,7 +17,7 @@ import { import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; -const presendObject: SendListener = (channelId, msg) => { +const presendObject: MessageSendListener = (channelId, msg) => { msg.content = textProcessing(msg.content); }; diff --git a/src/equicordplugins/sekaiStickers/index.tsx b/src/equicordplugins/sekaiStickers/index.tsx index 1d00584f..5b1840f0 100644 --- a/src/equicordplugins/sekaiStickers/index.tsx +++ b/src/equicordplugins/sekaiStickers/index.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons"; +import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons"; import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; import { openModal } from "@utils/modal"; @@ -21,7 +21,7 @@ const settings = definePluginSettings({ } }); -const SekaiStickerChatButton: ChatBarButton = () => { +const SekaiStickerChatButton: ChatBarButtonFactory = () => { return ( openModal(props => )} tooltip="Sekai Stickers"> {kanadeSvg()} diff --git a/src/equicordplugins/shakeSpearean.dev/index.ts b/src/equicordplugins/shakeSpearean.dev/index.ts index 1c06207a..f45ccdb7 100644 --- a/src/equicordplugins/shakeSpearean.dev/index.ts +++ b/src/equicordplugins/shakeSpearean.dev/index.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { addMessagePreSendListener, removeMessagePreSendListener, SendListener } from "@api/MessageEvents"; +import { addMessagePreSendListener, MessageSendListener, removeMessagePreSendListener } from "@api/MessageEvents"; import { definePluginSettings, Settings } from "@api/Settings"; import { EquicordDevs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; @@ -12,7 +12,7 @@ import { MessageStore } from "@webpack/common"; import { transferMessage } from "./native"; -const presendObject: SendListener = async (channelId, msg, extra) => { +const presendObject: MessageSendListener = async (channelId, msg, extra) => { const messageRef = extra.replyOptions.messageReference; const repliedMessage = ((messageRef?.message_id && messageRef.channel_id) && MessageStore.getMessage(messageRef?.channel_id, messageRef?.message_id)) || undefined; msg.content = await transferMessage(msg, Settings.plugins.Shakespearean.model, repliedMessage); diff --git a/src/equicordplugins/signature/index.tsx b/src/equicordplugins/signature/index.tsx index 8c40f41b..c160bab3 100644 --- a/src/equicordplugins/signature/index.tsx +++ b/src/equicordplugins/signature/index.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons"; +import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons"; import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from "@api/Commands"; import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu"; import { addMessagePreSendListener, removeMessagePreSendListener } from "@api/MessageEvents"; @@ -40,7 +40,7 @@ const settings = definePluginSettings( }, }); -const SignatureToggle: ChatBarButton = ({ isMainChat }) => { +const SignatureToggle: ChatBarButtonFactory = ({ isMainChat }) => { const { isEnabled, showIcon } = settings.use(["isEnabled", "showIcon"]); const toggle = () => settings.store.isEnabled = !settings.store.isEnabled; diff --git a/src/equicordplugins/woof/index.tsx b/src/equicordplugins/woof/index.tsx index f55f840b..fb93e052 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, removeChatBarButton } from "@api/ChatButtons"; +import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons"; import { Devs } from "@utils/constants"; import { getCurrentChannel, sendMessage } from "@utils/discord"; import definePlugin from "@utils/types"; @@ -14,7 +14,7 @@ async function handleButtonClick() { sendMessage(getCurrentChannel().id, { content: "woof" }); } -const ChatBarIcon: ChatBarButton = () => { +const ChatBarIcon: ChatBarButtonFactory = () => { return ( diff --git a/src/utils/types.ts b/src/utils/types.ts index 7527a221..1850342d 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -203,7 +203,7 @@ export type SettingsChecks = { (IsDisabled> & IsValid, DefinedSettings>); }; -export type PluginSettingDef = (PluginSettingCustomDef & Pick) | (( +export type PluginSettingDef = (PluginSettingCommon & PluginSettingCustomDef & Pick) | (( | PluginSettingStringDef | PluginSettingNumberDef | PluginSettingBooleanDef