silvanus/slash-commands/DEV_dumptree.js
2023-01-27 18:14:01 -05:00

20 lines
772 B
JavaScript

const { SlashCommandBuilder } = require('discord.js');
const dbfn = require('../modules/dbfn.js');
const fn = require('../modules/functions.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('dumptree')
.setDescription('Dump the contents of the tree message to console'),
async execute(interaction) {
await interaction.deferReply({ ephemeral: true });
const getGuildInfoResponse = await dbfn.getGuildInfo(interaction.guildId);
const { treeMessageId, treeChannelId } = getGuildInfoResponse.data;
interaction.guild.channels.fetch(treeChannelId).then(treeChannel => {
treeChannel.messages.fetch(treeMessageId).then(treeMessage => {
interaction.editReply("done");
console.log(JSON.stringify(treeMessage.embeds[0]));
});
});
},
};