MatrixBot.Sdk
1.0.3
dotnet add package MatrixBot.Sdk --version 1.0.3
NuGet\Install-Package MatrixBot.Sdk -Version 1.0.3
<PackageReference Include="MatrixBot.Sdk" Version="1.0.3" />
paket add MatrixBot.Sdk --version 1.0.3
#r "nuget: MatrixBot.Sdk, 1.0.3"
// 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 | Versions 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. |
-
net6.0
- System.Text.Json (>= 6.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.