AndanteTribe.DiscordClient
0.1.0
dotnet add package AndanteTribe.DiscordClient --version 0.1.0
NuGet\Install-Package AndanteTribe.DiscordClient -Version 0.1.0
<PackageReference Include="AndanteTribe.DiscordClient" Version="0.1.0" />
<PackageVersion Include="AndanteTribe.DiscordClient" Version="0.1.0" />
<PackageReference Include="AndanteTribe.DiscordClient" />
paket add AndanteTribe.DiscordClient --version 0.1.0
#r "nuget: AndanteTribe.DiscordClient, 0.1.0"
#:package AndanteTribe.DiscordClient@0.1.0
#addin nuget:?package=AndanteTribe.DiscordClient&version=0.1.0
#tool nuget:?package=AndanteTribe.DiscordClient&version=0.1.0
DiscordClient
English | 日本語
Overview
DiscordClient is a strongly typed Discord API client. Its async API methods and request and response models are generated from Discord's OpenAPI specification.
- APIs are grouped by resource, including users, channels, guilds, interactions, and webhooks.
- Supports Native AOT on .NET 10 and .NET 11 and uses source-generated
System.Text.Jsonmetadata for JSON serialization. Optional<T>lets update requests distinguish an omitted field from an explicitnull.
Installation
Requirements
The package targets .NET Standard 2.1, .NET 10, and .NET 11. Building from source or using C# 15 union features requires a compiler that supports C# 15, such as the compiler in the .NET 11 SDK. If C# 15 is still a preview in your SDK, set <LangVersion>preview</LangVersion> in your project file.
NuGet
Install AndanteTribe.DiscordClient from NuGet.
.NET CLI
dotnet add package AndanteTribe.DiscordClient
Package Manager
Install-Package AndanteTribe.DiscordClient
Unity
You can install AndanteTribe.DiscordClient in Unity by using NuGetForUnity. For setup instructions, see the NuGetForUnity README.
Unity projects require Unity 6.7 (6000.7) or later. On Unity 6.7 (6000.7) and Unity 7.0 (7000.0), enable the preview language version by passing -langversion:preview in one of these ways:
- Add
-langversion:previewon its own line inAssets/csc.rsp. - In Edit > Project Settings > Player > Other Settings > Script Compilation > Additional Compiler Arguments, add
-langversion:previewand select Apply.
Quick Start
Set ApiToken in the object initializer to your bot token, without the Bot prefix. The client uses the Bot authentication scheme by default.
using System;
using AndanteTribe.Api.Discord;
using var client = new DiscordClient
{
ApiToken = "YOUR_BOT_TOKEN"
};
var bot = await client.UsersApi.GetMyUserAsync();
Console.WriteLine(bot.Username);
To send a message with the same client, import AndanteTribe.Api.Discord.Model at the top of your file and pass the target channel ID and a MessageCreateRequest:
var message = await client.ChannelsApi.CreateMessageAsync(
"YOUR_CHANNEL_ID",
new MessageCreateRequest { Content = "Hello from DiscordClient!" });
API Reference
DiscordClient— configures authentication, request timeouts, and retry attempts. SetApiTokento supply a token explicitly, and setAuthenticationSchemeto"Bearer"when using an OAuth2 access token.- REST API interfaces — each interface documents the HTTP method and route for its operations.
- Request and response models — strongly typed models for Discord API payloads.
Optional<T>— leave an update field unset to omit it, or assignnullto send an explicit JSONnullwhere the field allows it.
License
This library is licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- System.Text.Json (>= 11.0.0)
-
net10.0
- System.Text.Json (>= 11.0.0)
-
net11.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 0 | 11/28/2026 |