- C# 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
Some checks failed
Test / build (push) Has been cancelled
Release / Build Package (push) Has been cancelled
Release / Build Package-1 (push) Has been cancelled
Release / Build Package-2 (push) Has been cancelled
Release / Build Package-3 (push) Has been cancelled
Release / Build Package-4 (push) Has been cancelled
Release / Build Package-5 (push) Has been cancelled
Release / publish-binaries (push) Has been cancelled
Release / Create Release (push) Has been cancelled
|
||
| .forgejo/workflows | ||
| assets | ||
| src | ||
| .gitignore | ||
| CHANGELOG.md | ||
| Kaede.sln | ||
| LICENSE.md | ||
| README.md | ||
Kaede
A Discord bot written in C# with Discord.Net that lets users create issues in any Toastielab repository via a slash command and modal form and post suggestions to a specified Discord channel
Table of contents:
Requirements
- .NET 9 SDK
- A Discord bot application (Discord Developer Portal)
- A Toastielab API token (Settings → Applications → Access Tokens on your Toastielab instance)
Setup
1. Discord Bot
- Go to the Discord Developer Portal and create a new application.
- Navigate to Bot and click Add Bot.
- Copy the Token — you'll need it for
config.yaml. - Under Privileged Gateway Intents, no extra intents are needed for slash commands.
- Go to OAuth2 → URL Generator, select:
- Scopes:
bot,applications.commands - Bot Permissions:
Send Messages,Embed Links
- Scopes:
- Copy the generated URL and invite the bot to your server.
2. Toastielab API Token
- Log in to your Toastielab instance (e.g.
https://toastielab.dev). - Go to Settings → Applications → Access Tokens.
- Create a token with at least Issue write permission.
- Copy the token.
Note
The token you create will only be able to see the repositories you have access to.
3. Configuration
Run the bot once to generate a default config.yaml, then fill it in and restart:
| Field | Description |
|---|---|
discord_token |
Your Discord bot token |
toastielab_base_url |
Base URL of your Toastielab instance (no trailing slash) |
toastielab_token |
Toastielab personal access token |
guild_id |
Discord server ID for instant guild commands. Set to 0 for global commands (up to 1 hour delay) |
suggestions_channel_id |
Discord channel ID for suggestions, (this is where the suggestion embeds are sent) |
staff_role_id |
The id of the staff role which will be used to allow staff members to accept suggestions |
staff_id |
The id of the user who is the bot owner (used for the setstatus command) |
Running
Running locally from the .csproj file
cd src
dotnet restore
dotnet run
Building then running
dotnet publish -c Release -o output
cd output
dotnet Kaede.dll
Commands
| Name | Command | Description |
|---|---|---|
| Create Issue | /create-issue |
Create an issue in a Toastielab repository via a modal form. |
| Stats | /stats |
Display Kaede's current runtime statistics including uptime, latency, memory usage, guild count, .NET version, and bot version. |
| Suggest | /suggest |
Submit a suggestion for the server. Staff can accept or deny suggestions directly in the suggestions channel. |
| Help | /help |
List all available commands and how to use them. |
| Set Status | /setstatus |
Set the bot's status. This requires the user to be the owner of the bot set via the bot_owner variable in the config.yaml file |
Project Structure
Kaede/
├── Commands/
│ ├── ICommand.cs # Interface all command modules implement
│ ├── CreateIssueCommand.cs # /create-issue — modal form, posts issue to Toastielab
│ ├── StatsCommand.cs # /stats — runtime statistics embed
│ ├── SuggestCommand.cs # /suggest — modal form, posts suggestion embed to channel
│ ├── HelpCommand.cs # /help — shows all available commands
│ └── SetStatusCommand.cs # /setstatus — allows the bot owner to set the bot's status
├── BotConfig.cs # Config loading and migration from config.yaml (YamlDotNet)
├── CommandHandler.cs # Registers commands and routes interactions to ICommand modules
├── ToastielabService.cs # Toastielab REST API calls
├── Logger.cs # Coloured console logger
├── Program.cs # Entry point, dependency injection setup
└── Kaede.csproj
Adding a new command
- Create a new file in
Commands/implementingICommand. - Add the command to the CommandService file. (Check line 19 in the file for more information)
CommandHandler will automatically pick it up, register it with Discord, and route interactions to it.
LICENSE
Copyright 2026 EllieBotDevs
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.