MatrixBot.Sdk 1.0.3

dotnet add package MatrixBot.Sdk --version 1.0.3
NuGet\Install-Package MatrixBot.Sdk -Version 1.0.3
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="MatrixBot.Sdk" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MatrixBot.Sdk --version 1.0.3
#r "nuget: MatrixBot.Sdk, 1.0.3"
#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.
// Install MatrixBot.Sdk as a Cake Addin
#addin nuget:?package=MatrixBot.Sdk&version=1.0.3

// Install MatrixBot.Sdk as a Cake Tool
#tool nuget:?package=MatrixBot.Sdk&version=1.0.3

MatrixBot .NET SDK

This open-source library allows you to build .NET chat bots compatible with Matrix Protocol. It has support for a limited subset of the APIs.

Use the SDK in your code

You can clone this repository and run MatrixBot.Sdk.Console.

Quickstart guide:

1. Create the Bot

var matrixBot = new MatrixBot.Sdk.MatrixBot();

Run it, and it will throw an error because there was no configuration available (yet).

2. Configure the Bot

Now you will have a matrixbot.json on disk, fill the blanks (serverUri, Username, Password ...) and run the sample again.

{
    "Since": "",
    "AccessToken": "",
    "UserId": "",
    "ServerUri": "https://matrix.org",
    "Username": "john.doe",
    "Password": "s3cr3t"
}

You can also Implement your own storage system (eg. database, xml etc.) by passing your own class implementing IMatrixBotStore in the MatrixBot constructor.

3. Add Event handler

matrixBot.OnEvent += (object? sender, MatrixBot.Sdk.MatrixBotEventArgs e) =>
{
    Console.WriteLine($"{e.RoomId} : {e.Event.Sender}");
};

4. Start the Bot!

matrixBot.Start();

And we are done.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
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
1.0.3 452 7/18/2022
1.0.2 381 7/18/2022
1.0.1 370 7/18/2022
1.0.0 374 7/8/2022