This is a semi-advanced Discord bot template written in C# (.NET 6) using DSharpPlus, made for developers that wish to start from a service-oriented and auto-extensible bot, rather than from scratch. The bot is backed by a database of your choice (SQLite, PostgreSQL), and it is easy to add more database providers to suit your needs. Logging is done via Serilog, and the bot configuration file has various switches that modify the logging procedure (log level, file logging, file rolling intervals etc.). The bot comes along with a owner-only module set, supplying basic commands such as avatar/name/status changes, code execution, command manipulation etc.
To see a more complex bot that inspired the creation of this example, check out TheGodfather!
Attributes
- Common attributes used throughout the project, mainly as command permission modifiersCommon
- Common classesCommon/Collections
- Custom useful data structuresCommon/Converters
- Command argument converters, new converters are automatically registered by the bot
Database
- Database-related controllers and context buildersDatabase/Models
- Database entities
EventListeners
- Discord event listeners, automatically registered by the bot if marked with an appropriate attributeExceptions
- Exception types used by the botExtensions
- Useful extensionsModules
- Bot command modules, automatically registered by the botServices
- Abstract and concrete services used by the bot