feat: add a way to show memory for debugging purposes
This commit is contained in:
parent
fe91bfc813
commit
420c66c6e1
1 changed files with 24 additions and 0 deletions
24
src/commands/utils/dumpMemory.ts
Normal file
24
src/commands/utils/dumpMemory.ts
Normal file
|
|
@ -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<CacheType>) {
|
||||
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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue