Open-source project
discord-net/Discord.Net avatar
discord-net/Discord.Net

Discord.Net: the C# wrapper for the Discord API, and what its versioning rules cost you

An unofficial .Net wrapper for the Discord API (https://discord.com/)

3,516 stars752 forksC#MIT

At a glance

What is it?
Discord.Net is an unofficial .NET wrapper for the Discord API, published on NuGet under the MIT licence. It covers REST and WebSocket access, text commands, slash-command interactions and webhooks, but its minor releases may break binary compatibility, which shapes how you pin versions.
Who is it for?
Adopt Discord.Net if your bot is a .NET service and you want REST, WebSocket, command and interaction handling behind one set of packages, with interfaces you consume rather than implement. Skip it if you need .NET Framework without retargeting, or if you want a library that promises forward compatibility on minor releases, because Discord.Net explicitly does not.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 21 days ago.
What is it written in?
Mainly C#, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What Discord.Net solves, and for whom

Discord.Net is an unofficial .NET API wrapper for the Discord API. The word unofficial matters: it is a community project, not something Discord publishes, and the README describes development as possible entirely by volunteers. The audience is C# developers building bots, integrations or webhook consumers who would otherwise hand-roll HTTP calls and maintain their own gateway connection logic. The repository is organised around that audience: src/ holds the libraries, samples/ holds runnable starting points such as BasicBot, InteractionFramework, TextCommandFramework, ShardedClient, WebhookClient and MediatRSample, and docs/ holds the documentation sources that feed the site at discordnet.dev. A developer who wants a working bot skeleton rather than an empty project has a sample to copy. A developer who wants a general-purpose HTTP client has no reason to be here.

The package split: Core, Rest, WebSocket, Commands, Interactions, Webhook

The library is not one monolith at the package level. The README lists a metapackage, Discord.Net, plus individual components: Discord.Net.Webhook for webhooks; Discord.Net.Commands and Discord.Net.Interactions for text-command and interaction services; Discord.Net.WebSocket and Discord.Net.Rest for what the README calls complete API coverage; and Discord.Net.Core, described as the API core that implements only entities and barebones functionality. That split is the real architectural decision. Core gives you entity types and minimal behaviour, so a library that only needs to read a payload can depend on Core and avoid the socket stack. A full bot pulls in the metapackage and gets the gateway client plus whichever command framework it chose. The trade-off is that you must know which layer you are writing against. If you install only Core and then look for a client to log in with, the README's own description tells you it is not there. Also present is Discord.Net.Providers.WS4Net, a separate package the README offers for legacy Windows targets that cannot use the built-in WebSocket support.

Installing Discord.Net and running a first bot

The README points at NuGet for stable builds and gives the metapackage as the default entry point. In a .NET project you add it with the dotnet CLI, using the package id exactly as published.

bash
dotnet add package Discord.Net

After the restore completes, the package and its dependencies appear in your project file and the Discord namespace becomes available. The repository ships runnable starting points under samples/, and samples/BasicBot is the smallest of them; the README does not spell out the login flow, so treat the sample as the reference rather than guessing at an API shape. Nightly builds are a separate channel. The README lists two sources for them, BaGet and GitHub Packages, and notes that GitHub Packages requires authentication, linking to GitHub's own instructions for authenticating to the NuGet registry. If you need an unreleased fix, that is where it lives, with the README's own warning that nightlies are experimental and not released.

Versioning guarantees, and the forward-compatibility gap

This is the part of the README most likely to affect your build pipeline. Discord.Net follows semantic versioning in MAJOR.MINOR.PATCH form, but the guarantees are asymmetric. A PATCH bump is described as internal-only, generally a bugfix, and is guaranteed forward- and backward-compatible with your codebase and with pre-compiled dependencies. A MINOR bump adds something and is not backwards-compatible with prior versions; more importantly, the README states that Discord.Net does not guarantee forward compatibility on minor additions, and that a limited set of breaking changes is permitted on a minor version bump. The stated reason is the Discord API itself: adding a property to an entity to track an upstream change is technically breaking because the library exposes interfaces as the way to consume entities. The project's compromise is to declare interfaces consumable only and to say applications should typically not implement them, with an apology to anyone who does so in test mocks. There is a second, sharper edge: the README says the project will occasionally break the ABI by adding parameters to methods to match upstream changes, so a minor increment may require recompiling your code and any addons. Binary breaking changes are supposed to be noted in release notes. If your deployment relies on binary compatibility across a patch upgrade of a dependency, this policy is the thing to design around.

Framework targets, TLS and the legacy Windows case

The known-issues section contains two constraints that can stop a bot before any code runs. First, WebSockets on Windows 7 and earlier: .NET Core 1.1 does not support them, the README says the issue was fixed in .NET Core 2.1, and it recommends targeting .NET Core 2.1 or above for legacy platforms, with Discord.Net.Providers.WS4Net as the alternative package. Second, TLS: Discord supports only TLS 1.2 and above on all its sites including the API, and .NET Framework does not support that protocol by default. The README suggests upgrading to net6-windows, which it says supports most Windows-only features and resolves startup errors caused by the protocol mismatch. This is where Discord.Net is the wrong tool for a project that cannot move off .NET Framework. The failure is a startup error from a protocol mismatch, not a compile error, so it surfaces at runtime. The README does not document a rollback path for a bot already deployed on an unsupported framework; the guidance is to retarget or to add the WS4Net provider for the socket problem.

Discord.Net compared with DSharpPlus

DSharpPlus is the other widely used .NET wrapper for the Discord API, and the difference that matters here is not feature count but release policy. Discord.Net's README commits to semantic versioning with a documented exception: minor bumps may break binary compatibility, and interfaces are consumable only. That exception exists because the underlying API changes and the library prefers to track it rather than freeze its surface. A team whose dependency policy forbids recompiling on minor upgrades is choosing between accepting that exception or picking a different wrapper whose stated policy fits. The README does not compare itself with DSharpPlus, so the honest comparison stops at the policy level: read both projects' versioning sections and decide which one matches how you ship. On the component split, Discord.Net's Core, Rest, WebSocket, Commands, Interactions and Webhook packages let you take only the layer you need, which is useful if you are writing a library rather than a bot.

Maintenance, licence and the cost of upgrading

The repository is not archived, and the last push was on 2026-09-09. The most recent tagged releases are 3.20.1 on 2026-06-07, 3.20.0 on 2026-06-06 and 3.19.1 on 2026-03-12, so the published line and the development branch are not the same thing: the README says dev is what pull requests target and that nightlies come from BaGet and GitHub Packages. Upgrading cost follows from the versioning rules. Patch upgrades are described as safe for your code and your pre-compiled dependencies. Minor upgrades may require a recompile of your code and of addons, and the release notes are where binary breaking changes are recorded, so reading them is part of the upgrade rather than optional. Major upgrades are breaking by definition and the README directs consumers to the release notes. The licence is MIT, which permits commercial and closed-source use and requires that the copyright notice and permission notice be included in copies or substantial portions of the software. That is the licence text, not legal advice; if your organisation has a licence review process, MIT is a short read. The README lists Open Collective, GitHub Sponsors and PayPal for financial support, and states that development is done by volunteers, which is the relevant context when you weigh how much you depend on unreleased fixes.

Editorial conclusion

Adopt Discord.Net if your bot is a .NET service and you want REST, WebSocket, command and interaction handling behind one set of packages, with interfaces you consume rather than implement. Skip it if you need .NET Framework without retargeting, or if you want a library that promises forward compatibility on minor releases, because Discord.Net explicitly does not. Before committing, read the versioning section of the README against your own dependency policy, decide whether the metapackage or individual packages fit, and check the TLS and WebSocket notes if your target framework is older than net6-windows.

Frequently asked questions

What is Discord.Net?

It is an unofficial .NET API wrapper for the Discord API, published on NuGet under the MIT licence. The README describes it as community-maintained, with development made possible entirely by volunteers.

How does Discord.Net compare with DSharpPlus?

Both are .NET wrappers for the Discord API. The documented difference is release policy: Discord.Net follows semantic versioning but permits a limited set of breaking changes on minor bumps and does not guarantee forward compatibility there, while interfaces are meant to be consumed and not implemented.

What alternatives to Discord.Net exist?

DSharpPlus is the other .NET wrapper named in this comparison. The README does not list alternatives itself, so the choice comes down to which project's versioning policy and package layout fit how you ship.

Official sources

  1. discord-net/Discord.Net on GitHub
  2. License: MIT
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/discord-net-discord-net.svg)](https://hysenlabs.com/projects/discord-net-discord-net)