sapphire-support
Root Question Message
body: []
, you remove the all slash commandSolution Message
const { Command } = require('@sapphire/framework');
class PingCommand extends Command {
constructor(context, options) {
super(context, { ...options });
}
registerApplicationCommands(registry) {
registry.registerChatInputCommand((builder) =>
builder.setName('ping').setDescription('Ping bot to see if it is alive')
);
}
}
module.exports = {
PingCommand
};
client.application.commands.fetch('123456789012345678') // id of your command
.then( (command) => {
console.log(`Fetched command ${command.name}`)
// further delete it like so:
command.delete()
console.log(`Deleted command ${command.name}`)
}).catch(console.error);
client.application.commands.delete
and skip the fetch middlemanconsole.log(client.application.commands.cache);
Collection(0) [Map] {}