Registers slash commands for a Discord bot application.
Remarks
This function reads all .js, .cjs and .mjs files in a specified directory and attempts to parse them as chat input commands
for Discord slash commands. It then sends the commands to the Discord API using the provided bot token.
Returns
An object containing the registered commands and any errors encountered during registration.
Registers slash commands for a Discord bot application.
Remarks
This function reads all
.js
,.cjs
and.mjs
files in a specified directory and attempts to parse them as chat input commands for Discord slash commands. It then sends the commands to the Discord API using the provided bot token.Returns
An object containing the registered commands and any errors encountered during registration.
Example