CloudTheWolf.DSharpPlus.Scaffolding.Shared
4.0.1-beta
dotnet add package CloudTheWolf.DSharpPlus.Scaffolding.Shared --version 4.0.1-beta
NuGet\Install-Package CloudTheWolf.DSharpPlus.Scaffolding.Shared -Version 4.0.1-beta
<PackageReference Include="CloudTheWolf.DSharpPlus.Scaffolding.Shared" Version="4.0.1-beta" />
<PackageVersion Include="CloudTheWolf.DSharpPlus.Scaffolding.Shared" Version="4.0.1-beta" />
<PackageReference Include="CloudTheWolf.DSharpPlus.Scaffolding.Shared" />
paket add CloudTheWolf.DSharpPlus.Scaffolding.Shared --version 4.0.1-beta
#r "nuget: CloudTheWolf.DSharpPlus.Scaffolding.Shared, 4.0.1-beta"
#:package CloudTheWolf.DSharpPlus.Scaffolding.Shared@4.0.1-beta
#addin nuget:?package=CloudTheWolf.DSharpPlus.Scaffolding.Shared&version=4.0.1-beta&prerelease
#tool nuget:?package=CloudTheWolf.DSharpPlus.Scaffolding.Shared&version=4.0.1-beta&prerelease
CloudTheWolf.DSharpPlus.Scaffolding.Shared
Shared bot and plugin contracts for CloudTheWolf DSharpPlus workers.
Plugin lifecycle
Plugins can initialize asynchronously and release resources during worker shutdown:
public sealed class ExamplePlugin : IPlugin
{
public string Name => "Example";
public string Id => "cloudthewolf.example";
public string Description => "Example plugin";
public int Version => 1;
public Version PluginVersion => new(1, 0, 0);
public Task InitializeAsync(
PluginContext context,
CancellationToken cancellationToken = default)
{
context.Bot.RegisterCommand(CommandBuilder.From(typeof(ExampleCommands)));
context.Bot.RegisterEventHandlers(Id, events => events
.HandleSessionCreated(OnSessionCreated));
context.Logger.Information("Plugin initialized");
return Task.CompletedTask;
}
public Task ShutdownAsync(CancellationToken cancellationToken = default)
{
return Task.CompletedTask;
}
}
PluginContext exposes the host-owned bot, logger, Discord configuration, and
application configuration. Plugins must not reconfigure or dispose the logger.
Existing plugins that implement InitPlugin(...) remain supported through the
default asynchronous lifecycle implementation.
Event handlers
Named registrations make duplicate ownership errors visible and preserve registration order. The registry is sealed when its contributions are applied to the Discord client, preventing late registrations that DSharpPlus cannot use.
Use IBot.RegisterEventHandlers(...) from plugins. IBot.EventHandlers also
supports inspecting registered names and removing a registration before startup.
The Worker can hot load, replace, and unload plugins by rebuilding the Discord client in-process. This preserves the Worker process while safely releasing all plugin-owned commands, event delegates, and collectible assembly contexts.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- CloudTheWolf.DSharpPlus.Scaffolding.Logging (>= 3.2.0.5)
- DSharpPlus (>= 5.0.0-nightly-02597)
- DSharpPlus.Commands (>= 5.0.0-nightly-02597)
- DSharpPlus.Interactivity (>= 5.0.0-nightly-02597)
- DSharpPlus.Natives.Opus (>= 1.6.1.31)
- DSharpPlus.Natives.Sodium (>= 1.0.22.22)
- DSharpPlus.Natives.Zstd (>= 1.5.7.22)
- DSharpPlus.VoiceNext (>= 5.0.0-nightly-02597)
- Lavalink4NET.DSharpPlus (>= 4.2.2)
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 |
|---|---|---|
| 4.0.1-beta | 154 | 8/9/2026 |
| 3.0.1.9-beta | 428 | 11/30/2025 |
| 3.0.1.8-beta | 342 | 11/12/2025 |
| 3.0.1.6-beta | 253 | 6/1/2025 |
| 3.0.1.5-beta | 184 | 2/9/2025 |
| 3.0.1.4-beta | 169 | 2/9/2025 |
| 3.0.1.2-beta | 161 | 2/9/2025 |
| 3.0.1.1-beta | 145 | 2/9/2025 |
| 3.0.1-beta | 149 | 2/9/2025 |
| 3.0.0.13-beta | 158 | 9/1/2024 |
| 3.0.0.12-beta | 206 | 8/3/2024 |
| 3.0.0.11-beta | 195 | 8/3/2024 |
| 3.0.0.10-beta | 172 | 8/3/2024 |
| 3.0.0.9-beta | 177 | 8/3/2024 |
| 3.0.0.8-beta | 193 | 8/1/2024 |
| 3.0.0.7-beta | 195 | 7/28/2024 |
| 3.0.0.6-beta | 193 | 7/27/2024 |
| 3.0.0.5-beta | 199 | 7/27/2024 |
| 3.0.0.4-beta | 174 | 4/12/2024 |
| 2.2.0.4 | 470 | 2/4/2024 |
Added async plugin lifecycle, plugin context, safer bot registration APIs, and named event handlers.