Registering commands
This section covers the essential steps and methods for registering commands in your Discord bot using Sunar.
Create a command
Define a new slash command or a context menu using Sunar's intuitive API and configure its properties such as name, description, options (if applicable), and permissions.
Listen for the ready
signal
Wait for the ready
signal from discord.js, indicating that the bot is connected and ready to register commands.
Register the commands
Now you can add the registerCommands
function provided by Sunar to dynamically register all the stored commands.
For more information about the registerCommands
function, see dynamic
registration.
See more
For global or specific server registration instructions, refer to the following links:
Last updated on