From 9023d45d9e594c49b09e4c7c0e6f23f539dad3d2 Mon Sep 17 00:00:00 2001 From: V Date: Mon, 29 May 2023 04:01:02 +0200 Subject: [PATCH] Improve /vencord-debug --- src/plugins/supportHelper.tsx | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/plugins/supportHelper.tsx b/src/plugins/supportHelper.tsx index 8b0880d1..cce7e9a3 100644 --- a/src/plugins/supportHelper.tsx +++ b/src/plugins/supportHelper.tsx @@ -31,6 +31,12 @@ import settings from "./settings"; const REMEMBER_DISMISS_KEY = "Vencord-SupportHelper-Dismiss"; +const AllowedChannelIds = [ + SUPPORT_CHANNEL_ID, + "1024286218801926184", // Vencord > #bot-spam + "1033680203433660458", // Vencord > #v +]; + export default definePlugin({ name: "SupportHelper", required: true, @@ -41,7 +47,7 @@ export default definePlugin({ commands: [{ name: "vencord-debug", description: "Send Vencord Debug info", - predicate: ctx => ctx.channel.id === SUPPORT_CHANNEL_ID, + predicate: ctx => AllowedChannelIds.includes(ctx.channel.id), execute() { const { RELEASE_CHANNEL } = window.GLOBAL_ENV; @@ -52,21 +58,26 @@ export default definePlugin({ return `Web (${navigator.userAgent})`; })(); + const isApiPlugin = (plugin: string) => plugin.endsWith("API") || plugins[plugin].required; + + const enabledPlugins = Object.keys(plugins).filter(p => Vencord.Plugins.isPluginEnabled(p) && !isApiPlugin(p)); + const enabledApiPlugins = Object.keys(plugins).filter(p => Vencord.Plugins.isPluginEnabled(p) && isApiPlugin(p)); + const debugInfo = ` **Vencord Debug Info** +>>> Discord Branch: ${RELEASE_CHANNEL} +Client: ${client} +Platform: ${window.navigator.platform} +Vencord: ${gitHash}${settings.additionalInfo} +Outdated: ${isOutdated} +OpenAsar: ${"openasar" in window} -> Discord Branch: ${RELEASE_CHANNEL} -> Client: ${client} -> Platform: ${window.navigator.platform} -> Vencord Version: ${gitHash}${settings.additionalInfo} -> OpenAsar: ${"openasar" in window} -> Outdated: ${isOutdated} -> Enabled Plugins: -${makeCodeblock(Object.keys(plugins).filter(Vencord.Plugins.isPluginEnabled).join(", "))} +Enabled Plugins (${enabledPlugins.length + enabledApiPlugins.length}): +${makeCodeblock(enabledPlugins.join(", ") + "\n\n" + enabledApiPlugins.join(", "))} `; return { - content: debugInfo.trim() + content: debugInfo.trim().replaceAll("```\n", "```") }; } }],