Sandbox
@Aiko-IT-Systems/DisCatSharp

C# Discord app library for .NET builders

DisCatSharp gives you the core Discord client plus package-level pieces for commands, interactivity, hosting, voice, and web ingress. You can compose only the parts you need instead of wiring Discord API access from scratch.

144 stars39 forksC#Updated 6d ago
Who it's for

Builders who want to make Discord bots and apps in C# with reusable client, command, and hosting packages.

What it delivers

You can build Discord apps with ready-made client, command, hosting, and voice pieces instead of assembling them yourself.

What it does

Core Discord client

Provides Gateway, REST, entities, and events in the main `DisCatSharp` package.

Slash and context commands

`DisCatSharp.ApplicationCommands` adds slash commands, context menus, autocomplete, and command groups.

Prefix commands

`DisCatSharp.CommandsNext` adds a text command framework for message-based bots.

Interactive bot flows

`DisCatSharp.Interactivity` adds waits, pagination, components, modals, and response helpers.

Hosting integration

`DisCatSharp.Hosting` and `DisCatSharp.Hosting.DependencyInjection` add Generic Host support and dependency-injection helpers.

ASP.NET Core ingress

`DisCatSharp.Hosting.AspNetCore` handles interactions, webhooks, OAuth callbacks, and linked roles.

Voice support

`DisCatSharp.Voice` and `DisCatSharp.Voice.Natives` support Discord voice connections and DAVE.

Documentation and examples

The repo includes docs under `DisCatSharp.Docs` and points to getting-started guides and example apps.

How to get it

  1. 1Install the latest stable release from NuGet
    dotnet add package DisCatSharp
  2. 2To use the latest nightly release instead
    dotnet add package DisCatSharp --prerelease

README

Build Documentation CodeQL

GitHub last commit GitHub commit activity GitHub pull requests GitHub code size in bytes

LTS Latest


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 bugs@aitsys.dev.

Tutorials and examples

Visual Studio tools


NuGet Packages

Main

PackagePurposeLTSLatest
DisCatSharpCore Discord API client with Gateway, REST, entities, and events.NuGetNuGet
DisCatSharp.ApplicationCommandsSlash commands, context menus, autocomplete, and command groups.NuGetNuGet
DisCatSharp.CommandsNextPrefix and text command framework.NuGetNuGet
DisCatSharp.InteractivityInteractive waits, pagination, components, modals, and response helpers.NuGetNuGet

Voice

PackagePurposeLTSLatest
DisCatSharp.LavalinkLavalink v4 client for remote audio playback.NuGetNuGet
DisCatSharp.VoiceDirect Discord voice connections with audio send, receive, and DAVE support.NuGetNuGet
DisCatSharp.Voice.NativesNative runtime libraries used by DisCatSharp.Voice.NuGetNuGet

Hosting

PackagePurposeLTSLatest
DisCatSharp.ConfigurationConfiguration models and binding for hosted bots.NuGetNuGet
DisCatSharp.Hosting.NET Generic Host integration and bot lifetime management.NuGetNuGet
DisCatSharp.Hosting.AspNetCoreASP.NET Core ingress for interactions, webhooks, OAuth callbacks, and linked roles.NuGetNuGet
DisCatSharp.Hosting.DependencyInjectionDependency-injection helpers for clients and hosted bots.NuGetNuGet

Templates

PackagePurposeLTSLatest
DisCatSharp.ProjectTemplatesProject templates for creating hosted DisCatSharp bots.NuGetNuGet

Development / Commons

PackagePurposeLTSLatest
DisCatSharp.AttributesShared annotations used by DisCatSharp packages and tooling.NuGetNuGet
DisCatSharp.CommonShared utilities, regular expressions, and converters.NuGetNuGet
DisCatSharp.ExperimentalExperimental and unsupported Discord features that may change without notice.NuGetNuGet
DisCatSharp.AnalyzerRecommended analyzers and code fixes for DisCatSharp applications.NuGetNuGet

Extensions

PackagePurposeLTSLatest
DisCatSharp.Extensions.TwoFactorCommandsRequire two-factor authentication for selected commands.NuGetNuGet
DisCatSharp.Extensions.OAuth2WebDeprecated. Legacy OAuth web server; migrate to DisCatSharp.Hosting.AspNetCore.NuGetNuGet
DisCatSharp.Extensions.SimpleMusicCommandsReady-to-use commands for building a simple music bot.NuGetNuGet

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 💕⭐

Files in the repo

Repository payload48 top-level entries
  • .devcontainer
  • .github
  • .nuget
  • DisCatSharp
  • DisCatSharp.ApplicationCommands
  • DisCatSharp.Attributes
  • DisCatSharp.CommandsNext
  • DisCatSharp.Common
  • DisCatSharp.Configuration
  • DisCatSharp.Docs
  • DisCatSharp.Experimental
  • DisCatSharp.Hosting
  • DisCatSharp.Hosting.AspNetCore
  • DisCatSharp.Hosting.DependencyInjection
  • DisCatSharp.Interactivity
  • DisCatSharp.Lavalink
  • DisCatSharp.Logos
  • DisCatSharp.Targets
  • DisCatSharp.Tests
  • DisCatSharp.Tools
  • DisCatSharp.Voice
  • DisCatSharp.Voice.Natives
  • skills
  • .editorconfig
  • .gitattributes
  • .gitignore
  • .hintrc
  • .repomixignore
  • AGENTS.md
  • ARTICLES.md
  • BUILDING.md
  • CHANGELOG.md
  • CLAUDE.md
  • CONTRIBUTING.md
  • Directory.Build.props
  • discatsharp-ai.xml
  • DisCatSharp.code-workspace
  • DisCatSharp.Release.slnx
  • DisCatSharp.slnx
  • GEMINI.md
  • jsconfig.json
  • LICENSE.md
  • NOTICE.md
  • package.json
  • README.md
  • RELEASENOTES.md
  • renovate.json
  • repomix.config.json

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More frameworks & sdks

HKUDS/nanobotFrameworks & SDKs

Ultra-lightweight, open-source, self-hosted personal AI agent framework in Python with WebUI, tools, memory, MCP, multi-agent workflows, automation, and chat apps

48k
microsoft/
SkillOpt
microsoft/SkillOptFrameworks & SDKs

SkillOpt is a text-space optimizer that trains reusable natural-language skills for frozen LLM agents through trajectory-driven edits, validation-gated updates, and deployable best_skill.md artifacts.

17k
omnigent-ai/omnigentFrameworks & SDKs

Omnigent is an open-source AI agent framework and meta-harness: orchestrate Claude Code, Codex, Cursor, Pi, and custom agents — swap harnesses without rewriting, enforce policies and sandboxing, and collaborate in real time from any device.

9.8k
kyegomez/
OpenMythos
kyegomez/OpenMythosFrameworks & SDKs

A theoretical reconstruction of the Claude Mythos architecture, built from first principles using the available research literature.

15k
D4Vinci/ScraplingFrameworks & SDKs

🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!

80k