Skip to content

KuchikiRenji/Onyix

Onyix — Open Source Discord Bot (C# / DSharpPlus)

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.


Table of Contents


Features

  • Slash commands/about, /level, /lock, /roll, /settings for 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

Requirements

  • .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

Quick Start

  1. Clone and restore

    git clone https://github.com/KuchikiRenji/Onyix.git
    cd Onyix
    dotnet restore
  2. 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 GUILD to your test server ID so slash commands register there immediately.

  3. Run the bot

    cd Onyix
    dotnet run

    Or press F5 in Visual Studio.


Configuration

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.


Debugging with Docker

  • Visual Studio: Choose the Docker launch profile from the debug target dropdown, then start debugging (F5).

  • CLI: From the Onyix project folder:

    dotnet run --launch-profile Docker

Requires Docker (or Docker Desktop on Windows).


Deploying with Docker

  1. Build the image from the Onyix project directory:

    docker build -t onyix .
  2. On your server (with Docker and MariaDB/MySQL), create a container and pass TOKEN and DATABASE as environment variables. Do not set GUILD in production.


Environment Variables

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

Contributing & License


Author & Contact

Onyix is maintained by KuchikiRenji.

Contact Value
GitHub KuchikiRenji
Email 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

About

Open-source Discord bot in C# with DSharpPlus — leveling, slash commands, MySQL, Docker.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors