CloudTheWolf.DSharpPlus.Scaffolding.Shared 4.0.1-beta

This is a prerelease version of CloudTheWolf.DSharpPlus.Scaffolding.Shared.
dotnet add package CloudTheWolf.DSharpPlus.Scaffolding.Shared --version 4.0.1-beta
                    
NuGet\Install-Package CloudTheWolf.DSharpPlus.Scaffolding.Shared -Version 4.0.1-beta
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CloudTheWolf.DSharpPlus.Scaffolding.Shared" Version="4.0.1-beta" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CloudTheWolf.DSharpPlus.Scaffolding.Shared" Version="4.0.1-beta" />
                    
Directory.Packages.props
<PackageReference Include="CloudTheWolf.DSharpPlus.Scaffolding.Shared" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CloudTheWolf.DSharpPlus.Scaffolding.Shared --version 4.0.1-beta
                    
#r "nuget: CloudTheWolf.DSharpPlus.Scaffolding.Shared, 4.0.1-beta"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CloudTheWolf.DSharpPlus.Scaffolding.Shared@4.0.1-beta
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CloudTheWolf.DSharpPlus.Scaffolding.Shared&version=4.0.1-beta&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CloudTheWolf.DSharpPlus.Scaffolding.Shared&version=4.0.1-beta&prerelease
                    
Install as a Cake Tool

CloudTheWolf.DSharpPlus.Scaffolding

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed

Added async plugin lifecycle, plugin context, safer bot registration APIs, and named event handlers.