41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
import { Strings } from "@core/i18n";
|
|
import {
|
|
ApplicationCommand,
|
|
ApplicationCommandOptionType,
|
|
} from "@lib/api/commands/types";
|
|
import { getDebugInfo } from "@lib/api/debug";
|
|
import { messageUtil } from "@metro/common";
|
|
|
|
export default () =>
|
|
<ApplicationCommand>{
|
|
name: "Goon",
|
|
description: Strings.COMMAND_DEBUG_DESC,
|
|
options: [
|
|
{
|
|
name: "ephemeral",
|
|
type: ApplicationCommandOptionType.BOOLEAN,
|
|
description: Strings.COMMAND_DEBUG_OPT_EPHEMERALLY,
|
|
},
|
|
],
|
|
execute([ephemeral], ctx) {
|
|
const info = getDebugInfo();
|
|
const content = [
|
|
"**💦GoonCord💦 Debug Info**",
|
|
`> GoonCord: ${info.bunny.version} (${info.bunny.loader.name} ${info.bunny.loader.version})`,
|
|
`> Discord: ${info.discord.version} (${info.discord.build})`,
|
|
`> React: ${info.react.version} (RN ${info.react.nativeVersion})`,
|
|
`> Hermes: ${info.hermes.version} (bcv${info.hermes.bytecodeVersion})`,
|
|
`> System: ${info.os.name} ${info.os.version} ${info.os.sdk ? `(SDK ${info.os.sdk})` : ""}`.trimEnd(),
|
|
`> Device: ${info.device.model}`,
|
|
].join("\n");
|
|
|
|
if (ephemeral?.value) {
|
|
messageUtil.sendBotMessage(ctx.channel.id, content);
|
|
} else {
|
|
const fixNonce = Date.now().toString();
|
|
messageUtil.sendMessage(ctx.channel.id, { content }, void 0, {
|
|
nonce: fixNonce,
|
|
});
|
|
}
|
|
},
|
|
};
|