Tengo el siguiente comando.
const { SlashCommandBuilder } = require("@discordjs/builders") module.exports ={ data: new SlashCommandBuilder() .setName("shutdown") .setDescription("Shutdown the bot"), async execute(interaction) { interaction.reply("Shutting down").then(() => { client.destroy(); }) } } El comando debe apagar el bot. Lo único que está haciendo en este momento es bloquear el bot porque ReferenceError: client is not defined . agradezco cualquier ayuda
Probar
process.exit()O
const { SlashCommandBuilder } = require("@discordjs/builders") module.exports ={ data: new SlashCommandBuilder() .setName("shutdown") .setDescription("Shutdown the bot"), async execute(interaction) { interaction.reply("Shutting down").then(() => { interaction.client.destroy(); }) } }