Registering a command

Here's how to register a command.

You only need to register each command one time.

It is recommended to use an eval() command for this, although this will work without the check.

There are two ways of setting up slash commands: For testing/guild-specific (instant changes), and for deployment/global (can take up to an hour to update).

bot.js
client.api.applications(client.user.id).guilds('guild-id-here').commands.post({
        data: {
            name: "help",
            description: "Get information about the bot."
            // possible options here e.g. options: [{...}]
        }
});

Last updated