From 3d21816a2fadc8170213f2c265509761fca8dc5e Mon Sep 17 00:00:00 2001
From: thororen1234 <78185467+thororen1234@users.noreply.github.com>
Date: Sat, 22 Nov 2025 17:39:46 -0500
Subject: [PATCH] fix lint
---
src/equicordplugins/baseDecoder/index.tsx | 71 +++++-----
src/equicordplugins/equicordToolbox/menu.tsx | 2 +-
src/equicordplugins/findReply/index.tsx | 13 +-
src/equicordplugins/holyNotes/index.tsx | 16 ++-
src/equicordplugins/husk/index.tsx | 74 +++++-----
.../components/DecryptionModal.tsx | 4 +-
.../invisibleChat.desktop/index.tsx | 126 +++++++++---------
src/equicordplugins/repeatMessages/index.tsx | 21 +--
.../soundBoardLogger/components/Icons.tsx | 14 +-
.../soundBoardLogger/index.tsx | 4 +-
src/equicordplugins/translatePlus/index.tsx | 25 ++--
.../translatePlus/utils/icon.tsx | 6 +-
.../unitConverter/ConverterAccessory.tsx | 32 +++--
src/equicordplugins/unitConverter/index.tsx | 12 +-
14 files changed, 218 insertions(+), 202 deletions(-)
diff --git a/src/equicordplugins/baseDecoder/index.tsx b/src/equicordplugins/baseDecoder/index.tsx
index b2febc025..8508dd465 100644
--- a/src/equicordplugins/baseDecoder/index.tsx
+++ b/src/equicordplugins/baseDecoder/index.tsx
@@ -112,42 +112,45 @@ export default definePlugin({
authors: [EquicordDevs.ThePirateStoner],
dependencies: ["MessagePopoverAPI"],
settings,
- renderMessagePopoverButton(msg) {
- const handleClick = () => {
- const base64Strings = findBase64Strings(msg.content);
- const decodedContent = decodeBase64Strings(base64Strings);
- if (settings.store.clickMethod === "Right") {
- decodedContent.forEach(content => copyWithToast(content));
- } else {
- openDecodedBase64Modal(decodedContent);
- }
- };
+ messagePopoverButton: {
+ icon: DecodeIcon,
+ render(msg) {
+ const handleClick = () => {
+ const base64Strings = findBase64Strings(msg.content);
+ const decodedContent = decodeBase64Strings(base64Strings);
+ if (settings.store.clickMethod === "Right") {
+ decodedContent.forEach(content => copyWithToast(content));
+ } else {
+ openDecodedBase64Modal(decodedContent);
+ }
+ };
- const handleContextMenu = e => {
- const base64Strings = findBase64Strings(msg.content);
- const decodedContent = decodeBase64Strings(base64Strings);
- if (settings.store.clickMethod === "Left") {
- e.preventDefault();
- e.stopPropagation();
- decodedContent.forEach(content => copyWithToast(content));
- } else {
- e.preventDefault();
- e.stopPropagation();
- openDecodedBase64Modal(decodedContent);
- }
- };
+ const handleContextMenu = e => {
+ const base64Strings = findBase64Strings(msg.content);
+ const decodedContent = decodeBase64Strings(base64Strings);
+ if (settings.store.clickMethod === "Left") {
+ e.preventDefault();
+ e.stopPropagation();
+ decodedContent.forEach(content => copyWithToast(content));
+ } else {
+ e.preventDefault();
+ e.stopPropagation();
+ openDecodedBase64Modal(decodedContent);
+ }
+ };
- const label = settings.store.clickMethod === "Right"
- ? "Copy Decoded (Left Click) / Decode Base64 (Right Click)"
- : "Decode Base64 (Left Click) / Copy Decoded (Right Click)";
+ const label = settings.store.clickMethod === "Right"
+ ? "Copy Decoded (Left Click) / Decode Base64 (Right Click)"
+ : "Decode Base64 (Left Click) / Copy Decoded (Right Click)";
- return {
- label,
- icon: DecodeIcon,
- message: msg,
- channel: ChannelStore.getChannel(msg.channel_id),
- onClick: handleClick,
- onContextMenu: handleContextMenu
- };
+ return {
+ label,
+ icon: DecodeIcon,
+ message: msg,
+ channel: ChannelStore.getChannel(msg.channel_id),
+ onClick: handleClick,
+ onContextMenu: handleContextMenu
+ };
+ }
}
});
diff --git a/src/equicordplugins/equicordToolbox/menu.tsx b/src/equicordplugins/equicordToolbox/menu.tsx
index f229b0227..1f2f45057 100644
--- a/src/equicordplugins/equicordToolbox/menu.tsx
+++ b/src/equicordplugins/equicordToolbox/menu.tsx
@@ -226,7 +226,7 @@ export function buildThemeMenuEntries() {
{
if (enabledThemes.includes(theme.fileName)) {
diff --git a/src/equicordplugins/findReply/index.tsx b/src/equicordplugins/findReply/index.tsx
index b5d4d0f3c..5f83dfbc3 100644
--- a/src/equicordplugins/findReply/index.tsx
+++ b/src/equicordplugins/findReply/index.tsx
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-import { addMessagePopoverButton, removeMessagePopoverButton } from "@api/MessagePopover";
+import { removeMessagePopoverButton } from "@api/MessagePopover";
import { definePluginSettings } from "@api/Settings";
import { disableStyle, enableStyle } from "@api/Styles";
import { Devs } from "@utils/constants";
@@ -94,9 +94,9 @@ export default definePlugin({
description: "Jumps to the earliest reply to a message in a channel (lets you follow past conversations more easily).",
authors: [Devs.newwares],
settings,
- start() {
- enableStyle(styles);
- addMessagePopoverButton("vc-findreply", message => {
+ messagePopoverButton: {
+ icon: FindReplyIcon,
+ render(message) {
if (!message.id) return null;
const replies = findReplies(message);
if (settings.store.hideButtonIfNoReply && !replies.length) return null;
@@ -148,7 +148,10 @@ export default definePlugin({
}
}
};
- });
+ }
+ },
+ start() {
+ enableStyle(styles);
},
stop() {
removeMessagePopoverButton("vc-findreply");
diff --git a/src/equicordplugins/holyNotes/index.tsx b/src/equicordplugins/holyNotes/index.tsx
index 03c19229b..37d711f34 100644
--- a/src/equicordplugins/holyNotes/index.tsx
+++ b/src/equicordplugins/holyNotes/index.tsx
@@ -20,7 +20,7 @@ import "./style.css";
import { NavContextMenuPatchCallback } from "@api/ContextMenu";
import { DataStore } from "@api/index";
-import { addMessagePopoverButton, removeMessagePopoverButton } from "@api/MessagePopover";
+import { removeMessagePopoverButton } from "@api/MessagePopover";
import ErrorBoundary from "@components/ErrorBoundary";
import { EquicordDevs } from "@utils/constants";
import { classes } from "@utils/misc";
@@ -112,11 +112,9 @@ export default definePlugin({
e.toolbar,
];
},
- async start() {
- if (await DataStore.keys(HolyNoteStore).then(keys => !keys.includes("Main"))) return noteHandler.newNoteBook("Main");
- if (!noteHandlerCache.has("Main")) await DataStoreToCache();
-
- addMessagePopoverButton("HolyNotes", message => {
+ messagePopoverButton: {
+ icon: NoteButtonPopover,
+ render(message) {
return {
label: "Save Note",
icon: NoteButtonPopover,
@@ -125,7 +123,11 @@ export default definePlugin({
onClick: () => noteHandler.addNote(message, "Main")
};
- });
+ }
+ },
+ async start() {
+ if (await DataStore.keys(HolyNoteStore).then(keys => !keys.includes("Main"))) return noteHandler.newNoteBook("Main");
+ if (!noteHandlerCache.has("Main")) await DataStoreToCache();
},
async stop() {
diff --git a/src/equicordplugins/husk/index.tsx b/src/equicordplugins/husk/index.tsx
index 9307c2109..11e3323d5 100644
--- a/src/equicordplugins/husk/index.tsx
+++ b/src/equicordplugins/husk/index.tsx
@@ -18,7 +18,6 @@
* along with this program. If not, see .
*/
-import { addMessagePopoverButton, removeMessagePopoverButton } from "@api/MessagePopover";
import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import { classes } from "@utils/misc";
@@ -70,40 +69,44 @@ export function Husk(props: IconProps) {
);
}
+const settings = definePluginSettings({
+ findInServer: {
+ description: "Attempt to find emoji of same name in server before using ID in settings (useful if no nitro)",
+ type: OptionType.BOOLEAN,
+ default: true
+ },
+ emojiName: {
+ description: "Emoji name (default (from Vencord Server): husk)",
+ type: OptionType.STRING,
+ default: "husk"
+ },
+ emojiID: {
+ description: "Emoji ID (default (from Vencord Server): 1026532993923293184)",
+ type: OptionType.BIGINT,
+ default: 1026532993923293184n
+ }
+});
+
+function getEmojiIdThatShouldBeUsed(guildId: string) {
+ if (!settings.store.findInServer || guildId === "") return settings.store.emojiID;
+ let id = "";
+ EmojiStore.getGuildEmoji(guildId).forEach(emoji => {
+ if (emoji.name === settings.store.emojiName) {
+ id = emoji.id;
+ }
+ });
+ return id !== "" ? id : settings.store.emojiID;
+}
+
export default definePlugin({
name: "Husk",
description: "Adds Husk button (check settings to change used emoji)",
authors: [Devs.nin0dev],
dependencies: ["MessagePopoverAPI"],
- settings: definePluginSettings({
- findInServer: {
- description: "Attempt to find emoji of same name in server before using ID in settings (useful if no nitro)",
- type: OptionType.BOOLEAN,
- default: true
- },
- emojiName: {
- description: "Emoji name (default (from Vencord Server): husk)",
- type: OptionType.STRING,
- default: "husk"
- },
- emojiID: {
- description: "Emoji ID (default (from Vencord Server): 1026532993923293184)",
- type: OptionType.BIGINT,
- default: 1026532993923293184n
- }
- }),
- getEmojiIdThatShouldBeUsed(guildId: string) {
- if (!this.settings.store.findInServer || guildId === "") return this.settings.store.emojiID;
- let id = "";
- EmojiStore.getGuildEmoji(guildId).forEach(emoji => {
- if (emoji.name === this.settings.store.emojiName) {
- id = emoji.id;
- }
- });
- return id !== "" ? id : this.settings.store.emojiID;
- },
- async start() {
- addMessagePopoverButton("Husk", msg => {
+ settings,
+ messagePopoverButton: {
+ icon: Husk,
+ render(msg) {
return {
label: "Husk",
icon: Husk,
@@ -112,16 +115,11 @@ export default definePlugin({
onClick: () => {
const guildId = ChannelStore.getChannel(msg.channel_id).guild_id !== null ? ChannelStore.getChannel(msg.channel_id).guild_id : "";
RestAPI.put({
- url: `/channels/${msg.channel_id}/messages/${msg.id}/reactions/${this.settings.store.emojiName}:${this.getEmojiIdThatShouldBeUsed(guildId)}/@me`
+ url: `/channels/${msg.channel_id}/messages/${msg.id}/reactions/${settings.store.emojiName}:${getEmojiIdThatShouldBeUsed(guildId)}/@me`
}
);
}
};
- });
- },
-
- stop() {
- removeMessagePopoverButton("Husk");
- },
-
+ },
+ }
});
diff --git a/src/equicordplugins/invisibleChat.desktop/components/DecryptionModal.tsx b/src/equicordplugins/invisibleChat.desktop/components/DecryptionModal.tsx
index 06b06a52f..b4946e28f 100644
--- a/src/equicordplugins/invisibleChat.desktop/components/DecryptionModal.tsx
+++ b/src/equicordplugins/invisibleChat.desktop/components/DecryptionModal.tsx
@@ -26,7 +26,7 @@ import {
} from "@utils/modal";
import { Button, React, TextInput } from "@webpack/common";
-import invisibleChatDesktop, { decrypt } from "../index";
+import { buildEmbed, decrypt } from "../index";
export function DecModal(props: any) {
const encryptedMessage: string = props?.message?.content;
@@ -54,7 +54,7 @@ export function DecModal(props: any) {
onClick={() => {
const toSend = decrypt(encryptedMessage, password, true);
if (!toSend || !props?.message) return;
- invisibleChatDesktop.buildEmbed(props?.message, toSend);
+ buildEmbed(props?.message, toSend);
props.onClose();
}}>
Decrypt
diff --git a/src/equicordplugins/invisibleChat.desktop/index.tsx b/src/equicordplugins/invisibleChat.desktop/index.tsx
index e6ba63e45..37a14d4d2 100644
--- a/src/equicordplugins/invisibleChat.desktop/index.tsx
+++ b/src/equicordplugins/invisibleChat.desktop/index.tsx
@@ -98,6 +98,49 @@ const settings = definePluginSettings({
}
});
+const EMBED_API_URL = "https://embed.sammcheese.net";
+const INV_REGEX = new RegExp(/( \u200c|\u200d |[\u2060-\u2064])[^\u200b]/);
+const URL_REGEX = new RegExp(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/);
+function colorCodeFromNumber(color: number): string {
+ return `#${[color >> 16, color >> 8, color]
+ .map(x => (x & 0xFF).toString(16))
+ .join("")}`;
+}
+
+async function getEmbed(url: URL): Promise