TDW.Marv.Core 0.9.1

dotnet add package TDW.Marv.Core --version 0.9.1
                    
NuGet\Install-Package TDW.Marv.Core -Version 0.9.1
                    
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="TDW.Marv.Core" Version="0.9.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TDW.Marv.Core" Version="0.9.1" />
                    
Directory.Packages.props
<PackageReference Include="TDW.Marv.Core" />
                    
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 TDW.Marv.Core --version 0.9.1
                    
#r "nuget: TDW.Marv.Core, 0.9.1"
                    
#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 TDW.Marv.Core@0.9.1
                    
#: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=TDW.Marv.Core&version=0.9.1
                    
Install as a Cake Addin
#tool nuget:?package=TDW.Marv.Core&version=0.9.1
                    
Install as a Cake Tool

TDW.Marv.Core

Core library for the Marv IRC bot. Provides the plugin API, bot abstractions, IRC protocol handling, and service registry.

Who is this for?

This package is for plugin authors building extensions for Marv. It provides the base classes, attributes, context types, and interfaces you need to write plugins.

If you're writing tests for your plugins, also add TDW.Marv.Testing.

Quick start

Create a class library targeting the same .NET version as Marv, add a reference to this package, and implement a plugin:

using Marv.Core.Platform;
using Marv.Core.Plugin;
using Microsoft.Extensions.Logging;

public class HelloPlugin : MarvPlugin
{
    public HelloPlugin(IBot bot, IPluginActivator activator, ILoggerFactory loggerFactory)
        : base(bot, activator, loggerFactory) { }

    [OnCommand("hello")]
    private async Task HandleHello(CommandContext ctx, CancellationToken ct)
    {
        await ctx.ReplyAsync($"Hi, {ctx.Sender.Nick}!", ct);
    }
}

Key types

Type Description
MarvPlugin Base class for all plugins
IBot Bot instance — send messages, query state
CommandContext Context for [OnCommand] handlers
RegexMatchContext Context for [OnRegex] handlers
IPluginActivator Create instances with DI resolution
IFilteringAttribute Declare handler filter attributes
FilterEvaluator<T> Implement handler filter logic

Handler attributes

Attribute Handler signature Fires when
[OnCommand("name")] Task(CommandContext, CancellationToken) Prefixed command message
[OnRegex("pattern")] Task(RegexMatchContext, CancellationToken) Message matches pattern
[OnEvent] Task(TEvent, CancellationToken) Typed event (inferred from parameter)
[OnRawMessage("CMD")] Task(IrcMessage, CancellationToken) Raw IRC message
[OnInterval(Seconds = n)] Task(CancellationToken) Timer tick while connected

All handler methods may omit the CancellationToken parameter.

Configuration

Declare a config class with [PluginConfig] and inject IOptions<T>:

[PluginConfig(Section = "MyPlugin")]
public record MyConfig
{
    public string Greeting { get; init; } = "Hello!";
}

Config binds to a root-level JSON section matching the Section name. IOptionsMonitor<T> is also available for live-reload support.

Services

Plugins can provide services to other plugins via [ProvidesService] and ConfigureServices. Consume services by adding constructor parameters (use = null for optional dependencies).

Documentation

Full API reference: Plugin API docs

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 (1)

Showing the top 1 NuGet packages that depend on TDW.Marv.Core:

Package Downloads
TDW.Marv.Testing

Test helpers for Marv IRC bot plugins. Provides builders for CommandContext, RegexMatchContext, events, and a plugin test harness.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.1 150 7/3/2026
0.9.0 139 6/28/2026
0.8.0 123 6/24/2026
0.7.2 125 6/17/2026
0.7.1 122 6/17/2026
0.7.0 219 6/17/2026
0.6.2 119 6/14/2026