diff --git a/src/plugins/_core/supportHelper.tsx b/src/plugins/_core/supportHelper.tsx index af5e86d88..6e363ed33 100644 --- a/src/plugins/_core/supportHelper.tsx +++ b/src/plugins/_core/supportHelper.tsx @@ -34,7 +34,7 @@ import { CONTRIB_ROLE_ID, Devs, DONOR_ROLE_ID, EQUICORD_TEAM, GUILD_ID, SUPPORT_ import { sendMessage } from "@utils/discord"; import { Logger } from "@utils/Logger"; import { Margins } from "@utils/margins"; -import { isAnyPluginDev, isEquicordGuild, isEquicordSupport, isSupportChannel, tryOrElse } from "@utils/misc"; +import { isAnyPluginDev, isEquicordGuild, isEquicordSupport, isKnownIssuesCategory, isSupportChannel, tryOrElse } from "@utils/misc"; import { relaunch } from "@utils/native"; import { onlyOnce } from "@utils/onlyOnce"; import { makeCodeblock } from "@utils/text"; @@ -462,7 +462,7 @@ export default definePlugin({ ); } - if (isSupportChannel(props.channel.id) && PermissionStore.can(PermissionsBits.SEND_MESSAGES, props.channel) && equicordSupport) { + if (equicordSupport && 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( - ); - } + + showToast("Success!", Toasts.Type.SUCCESS); + } catch (e) { + new Logger(this.name).error("Error while running snippet:", e); + showToast("Failed to run snippet :(", Toasts.Type.FAILURE); + } + }} + > + Run Snippet + + ); } } diff --git a/src/utils/misc.ts b/src/utils/misc.ts index e22fac446..2bde08052 100644 --- a/src/utils/misc.ts +++ b/src/utils/misc.ts @@ -19,7 +19,7 @@ import { User } from "@vencord/discord-types"; import { ChannelStore, GuildMemberStore, IconUtils } from "@webpack/common"; -import { EQUICORD_HELPERS, EquicordDevsById, GUILD_ID, SUPPORT_CHANNEL_ID, VencordDevsById } from "./constants"; +import { EQUICORD_HELPERS, EquicordDevsById, GUILD_ID, KNOWN_ISSUES_CHANNEL_ID, SUPPORT_CHANNEL_ID, VencordDevsById } from "./constants"; /** * Calls .join(" ") on the arguments @@ -119,6 +119,11 @@ export function isSupportChannel(channelId: string | null | undefined): boolean return channelId === SUPPORT_CHANNEL_ID; } +export function isKnownIssuesCategory(channelId: string | null | undefined): boolean { + if (!channelId) return false; + return channelId === KNOWN_ISSUES_CHANNEL_ID; +} + export function isEquicordSupport(userId: string | null | undefined): boolean { if (!userId) return false;