Onyix is a free, open-source Discord bot built in C# with DSharpPlus. It provides slash commands, server leveling and XP, moderation tools, and runs on .NET 7 with MySQL/MariaDB and Docker support. Self-host it on your own server or use it as a base for your own Discord bot.
- Features
- Requirements
- Quick Start
- Configuration
- Debugging with Docker
- Deploying with Docker
- Environment Variables
- Contributing & License
- Author & Contact
- Slash commands —
/about,/level,/lock,/roll,/settingsfor info, leveling, moderation, and fun - XP & leveling — Per-server XP from messages, configurable via guild settings
- MySQL / MariaDB — Persistent storage with Entity Framework Core
- Docker — Run and debug in containers; ready for production deployment
- NLog — Structured logging for debugging and monitoring
- GPL-3.0 — Open source; use, modify, and share
- .NET 7 SDK (or .NET 7 runtime if only running)
- Visual Studio 2022 or newer (optional; any editor + CLI works)
- MySQL or MariaDB — database must not exist beforehand (created by the app)
- Docker (optional) — for containerized run and deployment
-
Clone and restore
git clone https://github.com/KuchikiRenji/Onyix.git cd Onyix dotnet restore -
Set configuration
Use environment variables or user secrets. From the Onyix project directory:dotnet user-secrets set "TOKEN" "YOUR_DISCORD_BOT_TOKEN" dotnet user-secrets set "DATABASE" "Server=host;Database=onyix;User=user;Password=pass;"
For local testing you can set
GUILDto your test server ID so slash commands register there immediately. -
Run the bot
cd Onyix dotnet runOr press F5 in Visual Studio.
| Variable | Required | Description |
|---|---|---|
TOKEN |
Yes | Your Discord bot token |
DATABASE |
Yes | MySQL/MariaDB connection string; database will be created if missing |
GUILD |
No | Guild ID for instant slash command registration (dev only) |
MIGRATIONDATABASE |
No | Separate connection string for EF Core migrations |
Security: Never commit TOKEN or DATABASE. Use user secrets or environment variables. Do not set GUILD in production.
-
Visual Studio: Choose the Docker launch profile from the debug target dropdown, then start debugging (F5).
-
CLI: From the
Onyixproject folder:dotnet run --launch-profile Docker
Requires Docker (or Docker Desktop on Windows).
-
Build the image from the Onyix project directory:
docker build -t onyix . -
On your server (with Docker and MariaDB/MySQL), create a container and pass
TOKENandDATABASEas environment variables. Do not setGUILDin production.
| Name | Optional | Purpose |
|---|---|---|
TOKEN |
No | Discord bot token |
GUILD |
Yes | Debug guild ID (dev only) |
DATABASE |
No | MySQL/MariaDB connection string |
MIGRATIONDATABASE |
Yes | Connection string for EF migrations |
- License: GNU GPL v3
- Before contributing, read CODE_OF_CONDUCT.md and CONTRIBUTING.md.
Onyix is maintained by KuchikiRenji.
| Contact | Value |
|---|---|
| GitHub | KuchikiRenji |
| KuchikiRenji@outlook.com | |
| Discord | kuchiki_renji |
For bugs, feature ideas, or contributions, open an issue or a pull request.
Onyix — C# Discord bot • DSharpPlus • Open source • Leveling • Slash commands