diff options
author | V <vendicated@riseup.net> | 2023-06-16 19:07:22 +0200 |
---|---|---|
committer | V <vendicated@riseup.net> | 2023-06-16 19:07:22 +0200 |
commit | eaeb60308ee03f2340a1474c7eb75fd29fc49a90 (patch) | |
tree | 4dde43f53672fa8029ce64d0ca0b366752765f1f /src | |
parent | 662c0227eb353d71a41c01b0bd42e76e6fd09665 (diff) | |
download | Vencord-eaeb60308ee03f2340a1474c7eb75fd29fc49a90.tar.gz Vencord-eaeb60308ee03f2340a1474c7eb75fd29fc49a90.tar.bz2 Vencord-eaeb60308ee03f2340a1474c7eb75fd29fc49a90.zip |
[skip ci] Add version to /vencord-debug
Diffstat (limited to 'src')
-rw-r--r-- | src/globals.d.ts | 2 | ||||
-rw-r--r-- | src/plugins/supportHelper.tsx | 21 |
2 files changed, 16 insertions, 7 deletions
diff --git a/src/globals.d.ts b/src/globals.d.ts index 3d9e176..a1f6efc 100644 --- a/src/globals.d.ts +++ b/src/globals.d.ts @@ -37,6 +37,8 @@ declare global { export var IS_STANDALONE: boolean; export var IS_DISCORD_DESKTOP: boolean; export var IS_VENCORD_DESKTOP: boolean; + export var VERSION: string; + export var BUILD_TIMESTAMP: number; export var VencordNative: typeof import("./VencordNative").default; export var Vencord: typeof import("./Vencord"); diff --git a/src/plugins/supportHelper.tsx b/src/plugins/supportHelper.tsx index 9bade49..a90c13c 100644 --- a/src/plugins/supportHelper.tsx +++ b/src/plugins/supportHelper.tsx @@ -55,7 +55,10 @@ export default definePlugin({ if (IS_DISCORD_DESKTOP) return `Discord Desktop v${DiscordNative.app.getVersion()}`; if (IS_VENCORD_DESKTOP) return `Vencord Desktop v${VencordDesktopNative.app.getVersion()}`; if ("armcord" in window) return `ArmCord v${window.armcord.version}`; - return `Web (${navigator.userAgent})`; + + // @ts-expect-error + const name = typeof unsafeWindow !== "undefined" ? "UserScript" : "Web"; + return `${name} (${navigator.userAgent})`; })(); const isApiPlugin = (plugin: string) => plugin.endsWith("API") || plugins[plugin].required; @@ -63,14 +66,18 @@ export default definePlugin({ 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 info = { + Vencord: `v${VERSION} • ${gitHash}${settings.additionalInfo} - ${Intl.DateTimeFormat("en-GB", { dateStyle: "medium" }).format(BUILD_TIMESTAMP)}`, + "Discord Branch": RELEASE_CHANNEL, + Client: client, + Platform: window.navigator.platform, + Outdated: isOutdated, + OpenAsar: "openasar" in window, + }; + 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} +>>> ${Object.entries(info).map(([k, v]) => `${k}: ${v}`).join("\n")} Enabled Plugins (${enabledPlugins.length + enabledApiPlugins.length}): ${makeCodeblock(enabledPlugins.join(", ") + "\n\n" + enabledApiPlugins.join(", "))} |