It would be cool to integrate Slash commands support in Commando: https://discord.com/developers/docs/interactions/slash-commands.
It can be done with something like this:
client.registry.commands.forEach(command => {
client.api.applications(client.user.id).guilds('GUILD ID').commands.post({
data: {
name: command.name.replace(/-/g, ''),
description: command.description,
options: command.argsCollector?.args.map(arg => ({
name: arg.label.replace(/[\s/]/g, '-'),
description: arg.prompt,
type: getDiscordType(arg.type?.id),
required: typeof arg.default === 'undefined',
}))
}
})
})
client.ws.on('INTERACTION_CREATE', async interaction => {
// console.log(interaction)
// client.api.interactions(interaction.id, interaction.token).callback.post({
// data: {
// type: 4,
// data: {
// content: 'Hello world!'
// }
// }
// })
})```
It would be cool to integrate Slash commands support in Commando: https://discord.com/developers/docs/interactions/slash-commands.
It can be done with something like this: