Discord bot template code, using the Discord.NET library.
Aimed to be quick to fork and add your commands with all the overhead done for you.
- Multiple environments for development and production
- Thread safe logging
- Clean startup with early quits ensuring correct setup
- Automatic discovery of commands (thanks to Discord.NET)
- DI setup with a few singletons for injecting into commands
- Reflection-based
help
command, meaning you never have to change the command when you add new ones - Docker implementation, perfect for running in production.
Create environments folders called Development
and Production
- each one will be referred to as the env folder.
Then, for each environment respectively, create the following:
- Create a
config
folder - Create a
discordBotToken.txt
file, and place inside your bot token. - Create a
config.json
file, and fill it with valid JSON matching the data inside the Config model file.
The environment folders must be placed in the root directory for Docker in production, otherwise in the build output folder for debugging
Simply run ./runDocker.sh
on Linux (tested on Debian), and it will build + start the Docker container (automatic restarts on crash).