From d79aa162d25458c40cbf173c7adb54a9b1311eb4 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 5 Sep 2024 14:25:27 -0400 Subject: [PATCH] Ignore Some Typing --- src/equicordplugins/encryptcord/index.tsx | 8 ++++++++ src/equicordplugins/meow/index.tsx | 1 + src/equicordplugins/quoter/index.tsx | 1 + 3 files changed, 10 insertions(+) diff --git a/src/equicordplugins/encryptcord/index.tsx b/src/equicordplugins/encryptcord/index.tsx index 37fdb64d..80b11f12 100644 --- a/src/equicordplugins/encryptcord/index.tsx +++ b/src/equicordplugins/encryptcord/index.tsx @@ -50,7 +50,9 @@ const ChatBarIcon: ChatBarButton = ({ isMainChat }) => { const listener: SendListener = async (_, message) => { if (enabled) { const groupChannel = await DataStore.get("encryptcordChannelId"); + // @ts-expect-error typing issue if (getCurrentChannel().id !== groupChannel) { + // @ts-expect-error typing issue sendBotMessage(getCurrentChannel().id, { content: `You must be in <#${groupChannel}> to send an encrypted message!\n> If you wish to send an unencrypted message, please click the button in the chatbar.` }); message.content = ""; return; @@ -81,18 +83,24 @@ const ChatBarIcon: ChatBarButton = ({ isMainChat }) => { { + // @ts-expect-error typing issue if (await DataStore.get("encryptcordGroup") === false || (await DataStore.get("encryptcordChannelId") !== getCurrentChannel().id)) { setButtonDisabled(true); + // @ts-expect-error typing issue await sendTempMessage(getCurrentChannel().id, "", `join\`\`\`\n${await DataStore.get("encryptcordPublicKey")}\`\`\``, false); + // @ts-expect-error typing issue sendBotMessage(getCurrentChannel().id, { content: `*Checking for any groups in this channel...*\n> If none is found, a new one will be created \n> [Tip] You can do \`/encryptcord leave\` to leave a group` }); await sleep(5000); + // @ts-expect-error typing issue if (await DataStore.get("encryptcordGroup") === true && (await DataStore.get("encryptcordChannelId") !== getCurrentChannel().id)) { + // @ts-expect-error typing issue sendBotMessage(getCurrentChannel().id, { content: "*Leaving current group...*" }); await leave("", { channel: { id: await DataStore.get("encryptcordChannelId") } }); } else if (await DataStore.get("encryptcordGroup") === true) { setButtonDisabled(false); return; } + // @ts-expect-error typing issue await startGroup("", { channel: { id: getCurrentChannel().id } }); } setEnabled(!enabled); diff --git a/src/equicordplugins/meow/index.tsx b/src/equicordplugins/meow/index.tsx index 9dd03056..8a770ad7 100644 --- a/src/equicordplugins/meow/index.tsx +++ b/src/equicordplugins/meow/index.tsx @@ -10,6 +10,7 @@ import { getCurrentChannel, sendMessage } from "@utils/discord"; import definePlugin from "@utils/types"; async function handleButtonClick() { + // @ts-expect-error typing issue sendMessage(getCurrentChannel().id, { content: "meow" }); } diff --git a/src/equicordplugins/quoter/index.tsx b/src/equicordplugins/quoter/index.tsx index c1171c4d..70ba9d87 100644 --- a/src/equicordplugins/quoter/index.tsx +++ b/src/equicordplugins/quoter/index.tsx @@ -256,6 +256,7 @@ async function SendInChat(onClose) { const preview = generateFileNamePreview(recentmessage.content); const imageName = `${preview} - ${recentmessage.author.username}`; const file = new File([image], `${imageName}.png`, { type: "image/png" }); + // @ts-expect-error typing issue UploadHandler.promptToUpload([file], getCurrentChannel(), 0); onClose(); }