- create a Discord Bot on the Discord Developer Portal
- add a .env file under
src
with the following contents:TOKEN=the Token of your new bot CLIENT_ID=Application ID of your bot
- make sure you have
npm
installed - run
npm install npm run register
The bot can be started by running npm start
. It will then serve requests from any Discord server it was added to, until stopped.
Any file under ./src/commands is interpreted as a command file. It will need to have a default export implementing the ICommand interface. There is an example command, but there is much more you can do.
If you have more complicated commands that might error, you can throw
a CustomError, which will forward its error message to the user. Error messages of regular errors will be replaced by a generic error.
You should also adapt the createEmbedTemplate utility function to your needs.