From 1018491a0262d599180fb40765b615fac8ed040c Mon Sep 17 00:00:00 2001 From: Etorix <92535668+EtorixDev@users.noreply.github.com> Date: Sat, 13 Sep 2025 21:56:04 -0700 Subject: [PATCH 01/14] Fix BetterSettings. (#388) --- src/plugins/betterSettings/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/betterSettings/index.tsx b/src/plugins/betterSettings/index.tsx index ec2df1ba5..f3a0ec30c 100644 --- a/src/plugins/betterSettings/index.tsx +++ b/src/plugins/betterSettings/index.tsx @@ -131,7 +131,7 @@ export default definePlugin({ }, { match: /case \i\.\i\.DEVELOPER_OPTIONS:return \i;/, - replace: "$&case 'VencordPlugins':return $self.PluginsSubmenu();" + replace: "$&case 'EquicordPlugins':return $self.PluginsSubmenu();" } ] }, From e3d61cb60108a6b69436852ada1d52b9077acca1 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Sun, 14 Sep 2025 10:51:57 -0400 Subject: [PATCH 02/14] Building: Ignore File Types --- scripts/build/common.mjs | 1 + src/plugins/onePingPerDM/index.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/build/common.mjs b/scripts/build/common.mjs index b9b603396..e29404d36 100644 --- a/scripts/build/common.mjs +++ b/scripts/build/common.mjs @@ -162,6 +162,7 @@ export const globPlugins = kind => ({ const fileName = file.name; if (fileName.startsWith("_") || fileName.startsWith(".")) continue; if (fileName === "index.ts") continue; + if (/\.zip|rar|7z|tar|gz|bz2/.test(fileName)) continue; const target = getPluginTarget(fileName); diff --git a/src/plugins/onePingPerDM/index.ts b/src/plugins/onePingPerDM/index.ts index ff6428953..817523b4e 100644 --- a/src/plugins/onePingPerDM/index.ts +++ b/src/plugins/onePingPerDM/index.ts @@ -39,7 +39,7 @@ const settings = definePluginSettings({ }, alwaysPlaySound: { type: OptionType.BOOLEAN, - description: "Play message sound even when message sound is disabled", + description: "Play the message notification sound even when its disabled", restartNeeded: true, default: false } From 2fb86dc129ec135cabc4a15708cd6acbbad85567 Mon Sep 17 00:00:00 2001 From: YashRaj <91825864+YashRajCodes@users.noreply.github.com> Date: Sun, 14 Sep 2025 21:39:25 +0530 Subject: [PATCH 03/14] fix: grammar in the message sent on running /equicord-plugins when you have over 100 plugins enabled (#389) Co-authored-by: thororen1234 <78185467+thororen1234@users.noreply.github.com> --- src/plugins/_core/supportHelper.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/_core/supportHelper.tsx b/src/plugins/_core/supportHelper.tsx index a40ec11e8..4c29d1ec0 100644 --- a/src/plugins/_core/supportHelper.tsx +++ b/src/plugins/_core/supportHelper.tsx @@ -183,7 +183,7 @@ function generatePluginList() { }); - return `${user.username} have more than 100 plugins enabled, please reduce the number of enabled plugins to get support.`; + return `${user.username} has more than 100 plugins enabled, please reduce the number of enabled plugins to get support.`; } return content; From 843a2816b9aa8cb9947d105b307f85eeb6a306c3 Mon Sep 17 00:00:00 2001 From: SerStars <90714930+SerStars@users.noreply.github.com> Date: Sun, 14 Sep 2025 18:23:33 +0200 Subject: [PATCH 04/14] jellyfinRichPresence name options (#391) * Update jellyfinRichPresence plugin Added the ability to change the Rich Presence name (Watching Jellyfin -> Watching Whatever You Want) * Update instructions (Equicord#390) --- .../jellyfinRichPresence/index.tsx | 73 +++++++++++++++++-- 1 file changed, 66 insertions(+), 7 deletions(-) diff --git a/src/equicordplugins/jellyfinRichPresence/index.tsx b/src/equicordplugins/jellyfinRichPresence/index.tsx index 758f14df5..af04abb77 100644 --- a/src/equicordplugins/jellyfinRichPresence/index.tsx +++ b/src/equicordplugins/jellyfinRichPresence/index.tsx @@ -65,6 +65,19 @@ const settings = definePluginSettings({ description: "Jellyfin user ID obtained from your user profile URL", type: OptionType.STRING, }, + nameDisplay: { + description: "Choose how the application name should appear in Rich Presence", + type: OptionType.SELECT, + options: [ + { label: "Series/Movie Name", value: "default", default: true }, + { label: "Series - Episode/Track/Movie Name", value: "full" }, + { label: "Custom", value: "custom" }, + ], + }, + customName: { + description: "Custom Rich Presence name (only used if 'Custom' is selected).\nOptions: {name}, {series}, {season}, {episode}, {artist}, {album}, {year}", + type: OptionType.STRING, + }, overrideRichPresenceType: { description: "Override the rich presence type", type: OptionType.SELECT, @@ -113,16 +126,27 @@ function setActivity(activity: Activity | null) { export default definePlugin({ name: "JellyfinRichPresence", description: "Rich presence for Jellyfin media server", - authors: [EquicordDevs.vmohammad], + authors: [EquicordDevs.vmohammad, EquicordDevs.SerStars], settingsAboutComponent: () => ( <> How to get an API key - An API key is required to fetch your current media. To get one, go to your - Jellyfin dashboard, navigate to Administration {">"} API Keys and - create a new API key.

- + Auth token can be found by following these steps: +
    +
  1. 1. Log into your Jellyfin instance
  2. +
  3. 2. Open your browser's Developer Tools (usually F12 or right-click then Inspect)
  4. +
  5. 3. Go to the Network tab in Developer Tools
  6. +
  7. 4. Look for requests to your Jellyfin server
  8. +
  9. + 5. In the request headers, find X-MediaBrowser-Token or Authorization +
    + + Easiest way: press Ctrl+F in the Developer Tools and search for X-MediaBrowser-Token + +
  10. +
+
You'll also need your User ID, which can be found in the url of your user profile page.
@@ -197,6 +221,8 @@ export default definePlugin({ async getActivity(): Promise { let richPresenceType; + let appName: string; + const nameSetting = settings.store.nameDisplay || "default"; const mediaData = await this.fetchMediaData(); if (!mediaData) return null; @@ -214,6 +240,40 @@ export default definePlugin({ } } + const templateReplace = (template: string) => { + return template + .replace(/\{name\}/g, mediaData.name || "") + .replace(/\{series\}/g, mediaData.seriesName || "") + .replace(/\{season\}/g, mediaData.seasonNumber?.toString() || "") + .replace(/\{episode\}/g, mediaData.episodeNumber?.toString() || "") + .replace(/\{artist\}/g, mediaData.artist || "") + .replace(/\{album\}/g, mediaData.album || "") + .replace(/\{year\}/g, mediaData.year?.toString() || ""); + }; + + switch (nameSetting) { + case "full": + if (mediaData.type === "Episode" && mediaData.seriesName) { + appName = `${mediaData.seriesName} - ${mediaData.name}`; + } else if (mediaData.type === "Audio") { + appName = `${mediaData.artist || "Unknown Artist"} - ${mediaData.name}`; + } else { + appName = mediaData.name || "Jellyfin"; + } + break; + case "custom": + appName = templateReplace(settings.store.customName || "{name} on Jellyfish"); + break; + case "default": + default: + if (mediaData.type === "Episode" && mediaData.seriesName) { + appName = mediaData.seriesName; + } else { + appName = mediaData.name || "Jellyfin"; + } + break; + } + const largeImage = mediaData.imageUrl; const assets: ActivityAssets = { large_image: largeImage ? await getApplicationAsset(largeImage) : await getApplicationAsset("jellyfin"), @@ -243,8 +303,7 @@ export default definePlugin({ return { application_id: applicationId, - name: "Jellyfin", - + name: appName, details: getDetails(), state: getState() || "something", assets, From 9a16c82529210cc944d6104a3feb82d554382a83 Mon Sep 17 00:00:00 2001 From: YashRaj <91825864+YashRajCodes@users.noreply.github.com> Date: Mon, 15 Sep 2025 00:56:47 +0530 Subject: [PATCH 05/14] fix: prevent attempts to reply to messages stating that a message was pinned (#392) * fix: prevent attempts to reply to messages stating that a message was pinned * refactor: prevent linting error --------- Co-authored-by: thororen1234 <78185467+thororen1234@users.noreply.github.com> --- src/plugins/quickReply/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/quickReply/index.ts b/src/plugins/quickReply/index.ts index ffad86184..9cbef2637 100644 --- a/src/plugins/quickReply/index.ts +++ b/src/plugins/quickReply/index.ts @@ -134,6 +134,7 @@ function getNextMessage(isUp: boolean, isReply: boolean) { if (m.deleted) return false; if (!isReply && m.author.id !== meId) return false; // editing only own messages if (hasNoBlockedMessages && NoBlockedMessagesPlugin.isBlocked(m)) return false; + if (m.type === 6) return false; return true; }); From 3188ff391a9a76f0caea0c8786f7c64684733e3e Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Sun, 14 Sep 2025 17:04:49 -0400 Subject: [PATCH 06/14] Update Notif Check --- src/Vencord.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Vencord.ts b/src/Vencord.ts index fb1aad9fa..e052692e0 100644 --- a/src/Vencord.ts +++ b/src/Vencord.ts @@ -155,7 +155,7 @@ async function init() { syncSettings(); - if (!IS_WEB && !IS_UPDATER_DISABLED || !IS_DEV) { + if (!IS_DEV && !IS_WEB && !IS_UPDATER_DISABLED) { runUpdateCheck(); // this tends to get really annoying, so only do this if the user has auto-update without notification enabled From f7e8b0d0c34295d955e777d60c784457cd492e50 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Sun, 14 Sep 2025 23:43:02 -0400 Subject: [PATCH 07/14] EquicordHelper: Add Setting & Update description --- src/equicordplugins/equicordHelper/index.tsx | 159 ++++++++++--------- src/plugins/pinDms/index.tsx | 13 -- 2 files changed, 88 insertions(+), 84 deletions(-) diff --git a/src/equicordplugins/equicordHelper/index.tsx b/src/equicordplugins/equicordHelper/index.tsx index bd9672f90..b9f9ea77c 100644 --- a/src/equicordplugins/equicordHelper/index.tsx +++ b/src/equicordplugins/equicordHelper/index.tsx @@ -1,49 +1,41 @@ /* - * Vencord, a modification for Discord's desktop app - * Copyright (c) 2022 Vendicated and Megumin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ + * Vencord, a Discord client mod + * Copyright (c) 2025 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ import "@equicordplugins/_misc/styles.css"; +import { definePluginSettings, Settings } from "@api/Settings"; import { Devs, EQUICORD_HELPERS, EquicordDevs, GUILD_ID } from "@utils/constants"; import { Logger } from "@utils/Logger"; -import definePlugin from "@utils/types"; -import { Button, ChannelStore, Flex, Forms, GuildMemberStore, showToast, Toasts } from "@webpack/common"; +import definePlugin, { OptionType } from "@utils/types"; +import { Button, ChannelStore, Flex, GuildMemberStore, showToast, Toasts } from "@webpack/common"; import { JSX } from "react"; import { toggleEnabled } from "./utils"; +const settings = definePluginSettings({ + disableCreateDMButton: { + type: OptionType.BOOLEAN, + description: "Disables the create dm button", + restartNeeded: true, + default: false, + }, + disableDMContextMenu: { + type: OptionType.BOOLEAN, + description: "Disables the DM list context menu in favor of the x button", + restartNeeded: true, + default: false + } +}); export default definePlugin({ name: "EquicordHelper", - description: "Fixes some misc issues with discord", + description: "Used to provide support, fix discord caused crashes, and other misc features.", authors: [Devs.thororen, EquicordDevs.nyx, EquicordDevs.Naibuu], - settingsAboutComponent: () => <> - - This plugin was created to allow us as the Equicord Team & Contributors - to fix miscellaneous issues Discord may run into or cause. -
- This includes but is not limited to: -
- - Unknown Resolution/FPS Fixed? -
- - Whitelists all domains in CSP -
- , required: true, + settings, patches: [ // Fixes Unknown Resolution/FPS Crashing { @@ -58,47 +50,72 @@ export default definePlugin({ replace: "return $1;" } ] - } + }, + { + find: ".createDMButtonContainer,", + replacement: { + match: /"create-dm"\)/, + replace: "$&&&false" + }, + predicate: () => settings.store.disableCreateDMButton + }, + { + find: "#{intl::d+e27u::raw}", + replacement: { + match: /\{dotsInsteadOfCloseButton:(\i),rearrangeContextMenu:(\i).*?autoTrackExposure:!0\}\)/, + replace: "$1=false,$2=false" + }, + predicate: () => settings.store.disableDMContextMenu + }, ], - renderMessageAccessory(props) { - const buttons = [] as JSX.Element[]; - - const equicordSupport = GuildMemberStore.getMember(GUILD_ID, props.message.author.id)?.roles?.includes(EQUICORD_HELPERS); - - const msg = props.message.content?.toLowerCase() ?? ""; - - const contentWords = (msg.match(/`\w+`/g) ?? []).map(e => e.slice(1, -1)); - const matchedPlugins = Object.keys(Vencord.Plugins.plugins).filter(name => contentWords.includes(name.toLowerCase())); - const matchedPlugin = matchedPlugins.sort((a, b) => b.length - a.length)[0]; - const pluginData = matchedPlugin && Vencord.Plugins.plugins[matchedPlugin]; - const equicordGuild = ChannelStore.getChannel(props.channel.id)?.guild_id === GUILD_ID; - const ableCheck = msg.startsWith("enable") || msg.startsWith("disable"); - const shouldAddPluginButtons = equicordGuild && equicordSupport && matchedPlugin && pluginData && ableCheck; - - if (shouldAddPluginButtons) { - if (pluginData.required || pluginData.name.endsWith("API")) return; - const isEnabled = Vencord.Plugins.isPluginEnabled(matchedPlugin); - buttons.push( - - ); + start() { + if (Settings.plugins?.PinDMs?.disableCreateDMButton) { + settings.store.disableCreateDMButton = true; } - - return buttons.length - ? {buttons} - : null; + }, + renderMessageAccessory(props) { + return pluginToggleButtons(props); } }); + +function pluginToggleButtons(props) { + const buttons = [] as JSX.Element[]; + + const equicordSupport = GuildMemberStore.getMember(GUILD_ID, props.message.author.id)?.roles?.includes(EQUICORD_HELPERS); + + const msg = props.message.content?.toLowerCase() ?? ""; + + const contentWords = (msg.match(/`\w+`/g) ?? []).map(e => e.slice(1, -1)); + const matchedPlugins = Object.keys(Vencord.Plugins.plugins).filter(name => contentWords.includes(name.toLowerCase())); + const matchedPlugin = matchedPlugins.sort((a, b) => b.length - a.length)[0]; + const pluginData = matchedPlugin && Vencord.Plugins.plugins[matchedPlugin]; + const equicordGuild = ChannelStore.getChannel(props.channel.id)?.guild_id === GUILD_ID; + const ableCheck = msg.startsWith("enable") || msg.startsWith("disable"); + const shouldAddPluginButtons = equicordGuild && equicordSupport && matchedPlugin && pluginData && ableCheck; + + if (shouldAddPluginButtons) { + if (pluginData.required || pluginData.name.endsWith("API")) return; + const isEnabled = Vencord.Plugins.isPluginEnabled(matchedPlugin); + buttons.push( + + ); + } + + return buttons.length + ? {buttons} + : null; +} diff --git a/src/plugins/pinDms/index.tsx b/src/plugins/pinDms/index.tsx index 0cba4e332..a0832518c 100644 --- a/src/plugins/pinDms/index.tsx +++ b/src/plugins/pinDms/index.tsx @@ -62,11 +62,6 @@ export const settings = definePluginSettings({ default: {} as Record, description: "", }, - disableCreateDMButton: { - type: OptionType.BOOLEAN, - description: "Disables the create dm button", - default: true - } }); export default definePlugin({ @@ -159,14 +154,6 @@ export default definePlugin({ replace: "$self.getAllUncollapsedChannels().concat($&.filter(c=>!$self.isPinned(c)))" } }, - { - find: ".createDMButtonContainer,", - replacement: { - match: /"create-dm"\)/, - replace: "$&&&false" - }, - predicate: () => settings.store.disableCreateDMButton - }, ], sections: null as number[] | null, From f5a3d4e89ecc0e93c8bb46f20df451eea02309f1 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Mon, 15 Sep 2025 00:15:30 -0400 Subject: [PATCH 08/14] EquicordHelper: Update Support Buttons --- src/equicordplugins/equicordHelper/index.tsx | 38 +++++++++++++------- src/utils/misc.ts | 16 +++++++-- 2 files changed, 39 insertions(+), 15 deletions(-) diff --git a/src/equicordplugins/equicordHelper/index.tsx b/src/equicordplugins/equicordHelper/index.tsx index b9f9ea77c..6edc80c39 100644 --- a/src/equicordplugins/equicordHelper/index.tsx +++ b/src/equicordplugins/equicordHelper/index.tsx @@ -7,10 +7,11 @@ import "@equicordplugins/_misc/styles.css"; import { definePluginSettings, Settings } from "@api/Settings"; -import { Devs, EQUICORD_HELPERS, EquicordDevs, GUILD_ID } from "@utils/constants"; +import { Devs, EquicordDevs } from "@utils/constants"; import { Logger } from "@utils/Logger"; +import { isEquicordGuild, isEquicordSupport } from "@utils/misc"; import definePlugin, { OptionType } from "@utils/types"; -import { Button, ChannelStore, Flex, GuildMemberStore, showToast, Toasts } from "@webpack/common"; +import { Button, Flex, showToast, Toasts } from "@webpack/common"; import { JSX } from "react"; import { toggleEnabled } from "./utils"; @@ -80,37 +81,48 @@ export default definePlugin({ function pluginToggleButtons(props) { const buttons = [] as JSX.Element[]; - - const equicordSupport = GuildMemberStore.getMember(GUILD_ID, props.message.author.id)?.roles?.includes(EQUICORD_HELPERS); - const msg = props.message.content?.toLowerCase() ?? ""; const contentWords = (msg.match(/`\w+`/g) ?? []).map(e => e.slice(1, -1)); const matchedPlugins = Object.keys(Vencord.Plugins.plugins).filter(name => contentWords.includes(name.toLowerCase())); const matchedPlugin = matchedPlugins.sort((a, b) => b.length - a.length)[0]; - const pluginData = matchedPlugin && Vencord.Plugins.plugins[matchedPlugin]; - const equicordGuild = ChannelStore.getChannel(props.channel.id)?.guild_id === GUILD_ID; - const ableCheck = msg.startsWith("enable") || msg.startsWith("disable"); - const shouldAddPluginButtons = equicordGuild && equicordSupport && matchedPlugin && pluginData && ableCheck; + const pluginData = matchedPlugin ? Vencord.Plugins.plugins[matchedPlugin] : null; + + const isEquicord = isEquicordGuild(props.channel.id) && isEquicordSupport(props.message.author.id); + const startsWithEnabled = msg.startsWith("enable"); + const startsWithDisabled = msg.startsWith("disable"); + + const shouldAddPluginButtons = pluginData && isEquicord && (startsWithEnabled || startsWithDisabled); if (shouldAddPluginButtons) { if (pluginData.required || pluginData.name.endsWith("API")) return; const isEnabled = Vencord.Plugins.isPluginEnabled(matchedPlugin); + + let label = `${matchedPlugin} is already ${isEnabled ? "enabled" : "disabled"}`; + let disabled = true; + + if ((startsWithDisabled && isEnabled) || (startsWithEnabled && !isEnabled)) { + label = `${isEnabled ? "Disable" : "Enable"} ${matchedPlugin}`; + disabled = false; + } + buttons.push( ); } diff --git a/src/utils/misc.ts b/src/utils/misc.ts index 5c5848ccd..5eea811f7 100644 --- a/src/utils/misc.ts +++ b/src/utils/misc.ts @@ -16,10 +16,10 @@ * along with this program. If not, see . */ -import { Toasts } from "@webpack/common"; +import { ChannelStore, GuildMemberStore, Toasts } from "@webpack/common"; import { copyToClipboard } from "./clipboard"; -import { EquicordDevsById, VencordDevsById } from "./constants"; +import { EQUICORD_HELPERS, EquicordDevsById, GUILD_ID, VencordDevsById } from "./constants"; /** * Calls .join(" ") on the arguments @@ -116,3 +116,15 @@ export function tryOrElse(func: () => T, fallback: T): T { return fallback; } } + +export const isEquicordGuild = (id: string, isGuildId: boolean = false) => { + if (isGuildId) return id === GUILD_ID; + + const channel = ChannelStore.getChannel(id); + return channel.guild_id === GUILD_ID; +}; + +export const isEquicordSupport = (id: string) => { + const member = GuildMemberStore.getMember(GUILD_ID, id); + return member?.roles?.includes(EQUICORD_HELPERS); +}; From 675da92c3c6da8b647cdc47fd8799a9c1fd189e7 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Mon, 15 Sep 2025 00:27:27 -0400 Subject: [PATCH 09/14] Misc: Move More Funcs To Utils --- .../settings/tabs/vencord/index.tsx | 16 ++-------- src/plugins/_api/badges/index.tsx | 3 +- src/plugins/_core/supportHelper.tsx | 14 ++++----- src/utils/misc.ts | 29 ++++++++++++++----- 4 files changed, 32 insertions(+), 30 deletions(-) diff --git a/src/components/settings/tabs/vencord/index.tsx b/src/components/settings/tabs/vencord/index.tsx index 6e9d29261..478ad3b37 100644 --- a/src/components/settings/tabs/vencord/index.tsx +++ b/src/components/settings/tabs/vencord/index.tsx @@ -15,12 +15,10 @@ import { DonateButton, InviteButton } from "@components/settings/DonateButton"; import { QuickAction, QuickActionCard } from "@components/settings/QuickAction"; import { SpecialCard } from "@components/settings/SpecialCard"; import { gitRemote } from "@shared/vencordUserAgent"; -import { DONOR_ROLE_ID, GUILD_ID, VC_DONOR_ROLE_ID, VC_GUILD_ID } from "@utils/constants"; import { Margins } from "@utils/margins"; -import { identity, isEquicordPluginDev, isPluginDev } from "@utils/misc"; +import { identity, isEquicordDonor, isEquicordPluginDev, isPluginDev, isVencordDonor } from "@utils/misc"; import { relaunch } from "@utils/native"; -import { Button, Flex, Forms, GuildMemberStore, React, Select, Switch, UserStore } from "@webpack/common"; -import BadgeAPI from "plugins/_api/badges"; +import { Button, Flex, Forms, React, Select, Switch, UserStore } from "@webpack/common"; import { openNotificationSettingsModal } from "./NotificationSettings"; @@ -339,14 +337,4 @@ function DonateButtonComponent() { ); } -function isVencordDonor(userId: string): boolean { - const donorBadges = BadgeAPI.getDonorBadges(userId); - return GuildMemberStore.getMember(VC_GUILD_ID, userId)?.roles.includes(VC_DONOR_ROLE_ID) || !!donorBadges; -} - -export function isEquicordDonor(userId: string): boolean { - const donorBadges = BadgeAPI.getEquicordDonorBadges(userId); - return GuildMemberStore.getMember(GUILD_ID, userId)?.roles.includes(DONOR_ROLE_ID) || !!donorBadges; -} - export default wrapTab(EquicordSettings, "Equicord Settings"); diff --git a/src/plugins/_api/badges/index.tsx b/src/plugins/_api/badges/index.tsx index 4423b69a3..006885fda 100644 --- a/src/plugins/_api/badges/index.tsx +++ b/src/plugins/_api/badges/index.tsx @@ -21,10 +21,9 @@ import "./fixDiscordBadgePadding.css"; import { _getBadges, BadgePosition, BadgeUserArgs, ProfileBadge } from "@api/Badges"; import ErrorBoundary from "@components/ErrorBoundary"; import { openContributorModal } from "@components/settings/tabs"; -import { isEquicordDonor } from "@components/settings/tabs/vencord"; import { Devs } from "@utils/constants"; import { Logger } from "@utils/Logger"; -import { copyWithToast, shouldShowContributorBadge, shouldShowEquicordContributorBadge } from "@utils/misc"; +import { copyWithToast, isEquicordDonor, shouldShowContributorBadge, shouldShowEquicordContributorBadge } from "@utils/misc"; import definePlugin from "@utils/types"; import { User } from "@vencord/discord-types"; import { ContextMenuApi, Menu, Toasts, UserStore } from "@webpack/common"; diff --git a/src/plugins/_core/supportHelper.tsx b/src/plugins/_core/supportHelper.tsx index 4c29d1ec0..14adb11fc 100644 --- a/src/plugins/_core/supportHelper.tsx +++ b/src/plugins/_core/supportHelper.tsx @@ -22,11 +22,11 @@ import ErrorBoundary from "@components/ErrorBoundary"; import { Flex } from "@components/Flex"; import { Link } from "@components/Link"; import { openUpdaterModal } from "@components/settings/tabs/updater"; -import { CONTRIB_ROLE_ID, Devs, DONOR_ROLE_ID, EQUIBOP_CONTRIB_ROLE_ID, EQUICORD_HELPERS, EQUICORD_TEAM, GUILD_ID, SUPPORT_CHANNEL_ID, SUPPORT_CHANNEL_IDS, VC_CONTRIB_ROLE_ID, VC_DONOR_ROLE_ID, VC_GUILD_ID, VC_REGULAR_ROLE_ID, VC_SUPPORT_CHANNEL_IDS, VENCORD_CONTRIB_ROLE_ID } from "@utils/constants"; +import { CONTRIB_ROLE_ID, Devs, DONOR_ROLE_ID, EQUIBOP_CONTRIB_ROLE_ID, EQUICORD_TEAM, GUILD_ID, SUPPORT_CHANNEL_ID, SUPPORT_CHANNEL_IDS, VC_CONTRIB_ROLE_ID, VC_DONOR_ROLE_ID, VC_GUILD_ID, VC_REGULAR_ROLE_ID, VC_SUPPORT_CHANNEL_IDS, VENCORD_CONTRIB_ROLE_ID } from "@utils/constants"; import { sendMessage } from "@utils/discord"; import { Logger } from "@utils/Logger"; import { Margins } from "@utils/margins"; -import { isEquicordPluginDev, isPluginDev, tryOrElse } from "@utils/misc"; +import { isEquicordGuild, isEquicordPluginDev, isEquicordSupport, isPluginDev, isSupportChannel, tryOrElse } from "@utils/misc"; import { relaunch } from "@utils/native"; import { onlyOnce } from "@utils/onlyOnce"; import { makeCodeblock } from "@utils/text"; @@ -219,14 +219,14 @@ export default definePlugin({ name: "equicord-debug", description: "Send Equicord debug info", // @ts-ignore - predicate: ctx => isPluginDev(UserStore.getCurrentUser()?.id) || isEquicordPluginDev(UserStore.getCurrentUser()?.id) || GUILD_ID === ctx?.guild?.id, + predicate: ctx => isPluginDev(UserStore.getCurrentUser()?.id) || isEquicordPluginDev(UserStore.getCurrentUser()?.id) || isEquicordGuild(ctx?.guild?.id, true), execute: async () => ({ content: await generateDebugInfoMessage() }) }, { name: "equicord-plugins", description: "Send Equicord plugin list", // @ts-ignore - predicate: ctx => isPluginDev(UserStore.getCurrentUser()?.id) || isEquicordPluginDev(UserStore.getCurrentUser()?.id) || GUILD_ID === ctx?.guild?.id, + predicate: ctx => isPluginDev(UserStore.getCurrentUser()?.id) || isEquicordPluginDev(UserStore.getCurrentUser()?.id) || isEquicordGuild(ctx?.guild?.id, true), execute: () => { const pluginList = generatePluginList(); return { content: typeof pluginList === "string" ? pluginList : "Unable to generate plugin list." }; @@ -328,11 +328,11 @@ export default definePlugin({ renderMessageAccessory(props) { const buttons = [] as JSX.Element[]; - const equicordSupport = GuildMemberStore.getMember(GUILD_ID, props.message.author.id)?.roles?.includes(EQUICORD_HELPERS); + const equicordSupport = isEquicordSupport(props.message.author.id); const shouldAddUpdateButton = !IS_UPDATER_DISABLED - && ((props.channel.id === SUPPORT_CHANNEL_ID && equicordSupport)) + && ((isSupportChannel(props.channel.id) && equicordSupport)) && props.message.content?.includes("update"); if (shouldAddUpdateButton) { @@ -357,7 +357,7 @@ export default definePlugin({ ); } - if (props.channel.id === SUPPORT_CHANNEL_ID && PermissionStore.can(PermissionsBits.SEND_MESSAGES, props.channel)) { + if (isSupportChannel(props.channel.id) && PermissionStore.can(PermissionsBits.SEND_MESSAGES, props.channel)) { if (props.message.content.includes("/equicord-debug") || props.message.content.includes("/equicord-plugins")) { buttons.push(