DisCatSharp
A Discord app library written in C# for .NET
Why DisCatSharp?
If you:
- want a library where you get kind and efficient help
- would like to have and use the most recent features of the Discord API
- are ready to build great things
Then this is the right place for you!
History
We squashed DisCatSharp's Git history because of its clone size and accumulated clutter. The original history remains available through the releases, tags, and the archived pre-squash repository.
Install
Install the latest stable release from NuGet:
dotnet add package DisCatSharp
To use the latest nightly release instead:
dotnet add package DisCatSharp --prerelease
Packages are also available from GitHub Packages.
Quick start
Create a Discord bot account, store its token in the DISCORD_TOKEN environment variable, and connect the client:
using DisCatSharp;
using DisCatSharp.Enums;
string token = Environment.GetEnvironmentVariable("DISCORD_TOKEN")
?? throw new InvalidOperationException("Set the DISCORD_TOKEN environment variable.");
var discord = new DiscordClient(new DiscordConfiguration
{
Token = token,
TokenType = TokenType.Bot,
Intents = DiscordIntents.AllUnprivileged
});
await discord.ConnectAsync();
await Task.Delay(Timeout.InfiniteTimeSpan);
Continue with the complete first bot guide.
Documentation
The documentation is available at docs.dcs.aitsys.dev. A backup is available at backup-docs.dcs.aitsys.dev.
AI coding assistants
Install the consumer skill globally for Codex:
gh skill install Aiko-IT-Systems/DisCatSharp use-discatsharp --agent codex --scope user --pin main
Then add the public, stateless documentation MCP as a Streamable HTTP server named discatsharp:
[mcp_servers.discatsharp]
url = "https://docs.dcs.aitsys.dev/mcp"
The MCP provides live documentation search, symbol lookup, full-page retrieval, and indexed source access. See the Agent Skills and MCP setup guide for GitHub Copilot, Claude Code, Gemini CLI, other Agent Skills clients, version pinning, and maintainer guidance.
Bugs and feature requests
Join our official support guild, open an issue, or email [email protected].
Tutorials and examples
Visual Studio tools
NuGet Packages
Main
| Package | Purpose | LTS | Latest |
|---|---|---|---|
| DisCatSharp | Core Discord API client with Gateway, REST, entities, and events. | ||
| DisCatSharp.ApplicationCommands | Slash commands, context menus, autocomplete, and command groups. | ||
| DisCatSharp.CommandsNext | Prefix and text command framework. | ||
| DisCatSharp.Interactivity | Interactive waits, pagination, components, modals, and response helpers. |
Voice
| Package | Purpose | LTS | Latest |
|---|---|---|---|
| DisCatSharp.Lavalink | Lavalink v4 client for remote audio playback. | ||
| DisCatSharp.Voice | Direct Discord voice connections with audio send, receive, and DAVE support. | ||
| DisCatSharp.Voice.Natives | Native runtime libraries used by DisCatSharp.Voice. |
Hosting
| Package | Purpose | LTS | Latest |
|---|---|---|---|
| DisCatSharp.Configuration | Configuration models and binding for hosted bots. | ||
| DisCatSharp.Hosting | .NET Generic Host integration and bot lifetime management. | ||
| DisCatSharp.Hosting.AspNetCore | ASP.NET Core ingress for interactions, webhooks, OAuth callbacks, and linked roles. | ||
| DisCatSharp.Hosting.DependencyInjection | Dependency-injection helpers for clients and hosted bots. |
Templates
| Package | Purpose | LTS | Latest |
|---|---|---|---|
| DisCatSharp.ProjectTemplates | Project templates for creating hosted DisCatSharp bots. |
Development / Commons
| Package | Purpose | LTS | Latest |
|---|---|---|---|
| DisCatSharp.Attributes | Shared annotations used by DisCatSharp packages and tooling. | ||
| DisCatSharp.Common | Shared utilities, regular expressions, and converters. | ||
| DisCatSharp.Experimental | Experimental and unsupported Discord features that may change without notice. | ||
| DisCatSharp.Analyzer | Recommended analyzers and code fixes for DisCatSharp applications. |
Extensions
| Package | Purpose | LTS | Latest |
|---|---|---|---|
| DisCatSharp.Extensions.TwoFactorCommands | Require two-factor authentication for selected commands. | ||
| DisCatSharp.Extensions.OAuth2Web | Deprecated. Legacy OAuth web server; migrate to DisCatSharp.Hosting.AspNetCore. | ||
| DisCatSharp.Extensions.SimpleMusicCommands | Ready-to-use commands for building a simple music bot. |
Sponsors (Current & Past)
Thanks
Big thanks goes to the following people who helped us without being part of the core team ♥️
Special Thanks
The special thanks goes to Nagisa. Make sure to check out her Instagram ♥️♥️
The second special thanks goes to Sentry (GitHub) for sponsoring us with a business account on Sentry for error tracking. You guys are the best 💕⭐
No comments yet
Be the first to share your take.