From 420c66c6e116c1eb398acd3abd1d5fbdc156bb68 Mon Sep 17 00:00:00 2001 From: HerozDotExe Date: Fri, 20 Jun 2025 19:09:29 +0200 Subject: [PATCH] feat: add a way to show memory for debugging purposes --- src/commands/utils/dumpMemory.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/commands/utils/dumpMemory.ts diff --git a/src/commands/utils/dumpMemory.ts b/src/commands/utils/dumpMemory.ts new file mode 100644 index 0000000..36af793 --- /dev/null +++ b/src/commands/utils/dumpMemory.ts @@ -0,0 +1,24 @@ +import { + CacheType, + ChatInputCommandInteraction, + MessageFlags, + SlashCommandBuilder, +} from "npm:discord.js"; +import { Command } from "../../types.ts"; +import { memory } from "../../memory.ts"; + +export default { + data: new SlashCommandBuilder() + .setName("dump") + .setDescription("Dump memory (DEV ONLY)"), + async execute(interaction: ChatInputCommandInteraction) { + if (interaction.user.id === "586959027934724100") { + await interaction.reply({ + content: JSON.stringify(memory), + flags: MessageFlags.Ephemeral, + }); + } else { + await interaction.reply("You're not allow to do that."); + } + }, +} as Command;