Discord bot written in C# using the framework Discord.Net.
BonusBot has been written to do some stuff in Discord like for example:
- Play music from YouTube
- Delete multiple messages at once
- Ban people for a specific time and inform them
- Announce game planings for one of our Discord servers
- Output when someone leaves the server
- ... and much more
My previous repository could do all of them and maybe more (depends on at which date you are reading this).
But the code was terrible so I decided to rewrite the whole code.
Well, atleast it was much better than my first BonusBot :)
You can't invite the bot I'm already running for my private servers.
I honestly don't have a server with enough resources to be able to handle many guilds.
But you can:
Clone this repository
or
Use my Docker image directly.
- BONUSBOT_TOKEN
The token of the bot. - BONUSBOT_CLIENT_ID
The "CLIENT ID" of the bot (needed for WebDashboard. - BONUSBOT_CLIENT_SECRET
The "CLIENT SECRET" of the bot. - BONUSBOT_WEB_BASE_URL
The base url where the ASP.NET Core server is running.
E.g. my base url is "http://bonusbot.net". - BONUSBOT_ACTIVITY
Activity of the bot when started. - BONUSBOT_CONNECTION_STRING
Connection string for PostgreSQL.
There are the main, systems and module projects.
The main projects contain the logic to make BonusBot function for any functionality:
- Core:
Startup, Initialization, Dependency Injection, module references - Common:
Common logic for everything. - Database:
Entity Framework Core using PostgreSQL. - Services:
Services needed for BonusBot to work.
System projects are wrapper for Discord classes to mostly improve speed of the bot with caching and make the code better.
Modules contain all the functionalities and commands.
They can be added and removed easily, need to be referenced from Core and need to end with 'Module'.
The module 'ModulesControllingModule' allows the guild administrators to enable and disable the modules for their guild.
- Lavalink:
Used in AudioModule for sending audio from e.g. YouTube or Soundcloud - gRPC with Google.Protobuf:
For my private modules to allow sending to and receiving from my other project. - Npgsql Entity Framework Core Provider
Provider for EF Core and PostgreSQL. - Macross.Json.Extensions:
To be able to convert string to enum or vice versa with custom names in System.Text.Json. - Colorful.Console:
Enhanced styling functionality for the console. - MoreLINQ:
More functionalities for LINQ. - Docker:
This code is written to work in a Docker container. If you don't want to use it, you can modify the code - it should be pretty easy.
E.g. the ConnectionString in BonusDbContextFactory.cs uses an absolute path for a Docker volume, modify it. - ... and more from .NET Team