feat: crash info in /vencord-debug (#1714)

Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
Lewis Crichton 2023-09-08 02:41:30 +01:00 committed by GitHub
parent 5e3a485edc
commit f2a22c5e57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,7 +48,7 @@ export default definePlugin({
name: "vencord-debug",
description: "Send Vencord Debug info",
predicate: ctx => AllowedChannelIds.includes(ctx.channel.id),
execute() {
async execute() {
const { RELEASE_CHANNEL } = window.GLOBAL_ENV;
const client = (() => {
@ -75,6 +75,10 @@ export default definePlugin({
OpenAsar: "openasar" in window,
};
if (IS_DISCORD_DESKTOP) {
info["Last Crash Reason"] = (await DiscordNative.processUtils.getLastCrash())?.rendererCrashReason ?? "N/A";
}
const debugInfo = `
**Vencord Debug Info**
>>> ${Object.entries(info).map(([k, v]) => `${k}: ${v}`).join("\n")}