A boilerplate DSharpPlus Discord bot on .NET 6.0 using Docker
- You will need to have a version Docker Compose installed that is compatible with version >= 3.4 docker-compose files.
- Next, you will need to setup a Discord application and bot on the Discord Developer Portal if you do not already have one. Take note of the bot's token.
- You can modify the default bot configuration settings by editing the environment section of the
docker-compose.override.yml
file or theappsettings.Development.json
file. The docker-compose environment variables have the highest priority over other configuration files.
- IMPORTANT: Make sure to add the Discord bot's token to either the
BotSettings__Token
environment variable or theToken
key in theappsettings.Development.json
file otherwise the bot will fail to start.
- Once all the services are running, you can access the bot's logs on the local Seq instance on port 5340 by default.
The confirmordeny
command allows you to gamify a question (Optionally to a different channel). Multiword sentences
should be wrapped in quotes (ie; "The quick brown fox"). The delay parameter allows you to add a delayed timelimit
for the question to be answered.
!confirmordeny <question> [channelName] [delay]
The deletemessages
command deletes the number of messages specified from the channel it is sent to. This command
requires owner permissions.
!deletemessages [limit]
The command to manually run Dockerized unit tests:
docker-compose -f docker-compose.tests.yml build --no-cache
Otherwise, you can target the "tests" stage in Unittests.Dockerfile
.