Lyo.Discord.Client
2.0.0
dotnet add package Lyo.Discord.Client --version 2.0.0
NuGet\Install-Package Lyo.Discord.Client -Version 2.0.0
<PackageReference Include="Lyo.Discord.Client" Version="2.0.0" />
<PackageVersion Include="Lyo.Discord.Client" Version="2.0.0" />
<PackageReference Include="Lyo.Discord.Client" />
paket add Lyo.Discord.Client --version 2.0.0
#r "nuget: Lyo.Discord.Client, 2.0.0"
#:package Lyo.Discord.Client@2.0.0
#addin nuget:?package=Lyo.Discord.Client&version=2.0.0
#tool nuget:?package=Lyo.Discord.Client&version=2.0.0
Lyo.Discord.Client
Typed HTTP client for the Discord REST endpoints Lyo.Api exposes (the Discord/* group registered by Lyo.Discord.Postgres). Wraps Lyo.Api.Client.ApiClient so Accept-Encoding, request compression, and problem-details parsing match the other Lyo clients.
Examples
Wire into DI (Extensions.cs)
services.AddDiscordClientFromConfiguration(builder.Configuration);
// or:
services.AddDiscordClient(o => {
o.BaseUrl = "https://api.example.com/";
o.RequestCompression = ApiRequestCompressionType.Gzip;
});
Manager surface
LyoDiscordClient is the entry point. It subclasses ApiClient and exposes nine manager properties under Managers/:
| Property | Manager | Endpoints (relative to the API base) |
|---|---|---|
Guilds |
GuildManager |
Discord/Guild Query/Get/Upsert/Bulk Upsert; …/{guildId}/GuildSettings GET/PUT |
Users |
UserManager |
Discord/User Query/Get/Upsert/Bulk Upsert |
Channels |
ChannelManager |
Discord/Channel Query/Get/Upsert/Bulk Upsert |
Roles |
RoleManager |
Discord/Role Query/Get/Upsert/Bulk Upsert |
Emojis |
EmojiManager |
Discord/Emoji Query/Get/Upsert/Bulk Upsert |
Interactions |
InteractionManager |
Discord/Interaction Query/Get/Upsert/Bulk Upsert |
Messages |
MessageManager |
Discord/Message Query and Bulk Upsert |
Attachments |
AttachmentManager |
Discord/Attachment Query/Get/Upsert |
Members |
MemberManager |
Discord/Member Query/Upsert/Bulk Upsert/Patch (composite PK (UserId, GuildId) so no GET-by-id) |
Routes come from Lyo.Discord.Models.Constants.Rest.Discord; request/response DTOs from
Lyo.Discord.Models. Guild-settings methods on GuildManager (GetSettingsAsync, PutSettingsAsync) hit the config-store routes mapped by
MapDiscordGuildSettingsEndpoints.
Settings (LyoDiscordClientOptions)
Binds from section LyoDiscordClient (overrides the base ApiClient section). Picks up every ApiClientOptions flag (BaseUrl, EnsureStatusCode, AcceptEncodings, RequestCompression, …). BaseUrl defaults to http://localhost:5251/ so a local Lyo API host is the target. Override for any other deployment.
Wire into DI (Extensions.cs)
| Method | Description |
|---|---|
AddDiscordClientFromConfiguration(configuration, sectionName?) |
Reads LyoDiscordClientOptions from configuration (default section "LyoDiscordClient") and registers LyoDiscordClient as a singleton. |
AddDiscordClient(Action<LyoDiscordClientOptions> configure) |
Constructs options in place. |
AddDiscordClient(LyoDiscordClientOptions options) |
Takes a ready-made options object. |
Every overload injects any registered ILoggerFactory and reuses a shared HttpClient from DI when one is present; otherwise the underlying ApiClient constructor builds its own
handler with auto-decompression enabled.
Dependencies
Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).
Lyo.Api.Models(direct, lyo)Lyo.Common.Json(direct, lyo)Lyo.Discord.Models(direct, lyo)Lyo.Http.Client(direct, lyo)Lyo.Metrics(direct, lyo)Lyo.Query.Models(direct, lyo)Microsoft.Extensions.Configuration10.0.5(direct, microsoft)Microsoft.Extensions.DependencyInjection.Abstractions10.0.5(direct, microsoft)Microsoft.Extensions.Http10.0.5(direct, microsoft)Microsoft.Extensions.Logging.Abstractions10.0.5(direct, microsoft)Lyo.Common.Core(transitive, lyo)Lyo.Common.Metadata(transitive, lyo)Lyo.Configuration(transitive, lyo)Lyo.DateAndTime(transitive, lyo)Lyo.Exceptions(transitive, lyo)Lyo.Parameters(transitive, lyo)Lyo.Result(transitive, lyo)AngleSharp1.5.0(transitive, third-party)Microsoft.Bcl.AsyncInterfaces10.0.5(transitive, microsoft, netstandard2.0)Microsoft.Extensions.Configuration.Binder10.0.5(transitive, microsoft)System.Memory4.6.3(transitive, microsoft, netstandard2.0)System.Text.Json10.0.5(transitive, microsoft, netstandard2.0)System.Threading.RateLimiting10.0.5(transitive, microsoft)
| 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. 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.0
- Lyo.Api.Models (>= 2.0.0)
- Lyo.Common.Json (>= 2.0.0)
- Lyo.Discord.Models (>= 2.0.0)
- Lyo.Http.Client (>= 2.0.0)
- Lyo.Metrics (>= 2.0.0)
- Lyo.Query.Models (>= 2.0.0)
- Microsoft.Extensions.Configuration (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Http (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
-
net10.0
- Lyo.Api.Models (>= 2.0.0)
- Lyo.Common.Json (>= 2.0.0)
- Lyo.Discord.Models (>= 2.0.0)
- Lyo.Http.Client (>= 2.0.0)
- Lyo.Metrics (>= 2.0.0)
- Lyo.Query.Models (>= 2.0.0)
- Microsoft.Extensions.Configuration (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Http (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Lyo.Discord.Client:
| Package | Downloads |
|---|---|
|
Lyo.Discord.Bot
DSharpPlus bot host that syncs Discord guild data to the Lyo API (DI, configuration, extensible base class). |
GitHub repositories
This package is not used by any popular GitHub repositories.