RSMatrix 1.0.4

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

RSMatrix

Scope

For now this is just a little sideproject to support the matrix.org chat protocol in .NET. I tried several libraries and got none of them to work as they were all still in beta or abandoned.

Implementing this using the Client spec version 1.14

The goal is to have a simple text client which can retrieve and send text messages for Chatbot development. It's not intended as a comprehensive library for building a client UI.

I will try to make it conform to all requirements. It sends automatic receipts and read notifications.

End-to-End Encryption is a bonus, not sure if it will eventually be supported.

Example

Check the github repository for a minimalistic console example. Here is the basic usage:

MatrixTextClient client = await MatrixTextClient.ConnectAsync(userid, password, device,
    httpClientFactory, cancellationToken, logger);

and to handle messages:

await foreach (var message in client.Messages.ReadAllAsync(cancellationToken))
{
    Console.WriteLine(message);
    await message.Room.SendTypingNotificationAsync();
    if(message.Body.Equals("ping", StringComparison.OrdinalIgnoreCase))
        await message.SendResponseAsync("pong!");
}

Room and user information is cached and updated on the client object. Associated rooms and users are included in the message given to the handler. The Messages channel is closed when the client is disconnected through CancellationToken or if a request fails. Consider reconnecting in that case by calling ConnectAsync() again.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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
1.0.4 176 8/27/2025
1.0.3 192 7/10/2025
1.0.2 280 4/5/2025
1.0.1 204 2/23/2025
1.0.0 111 2/23/2025
1.0.0-beta-5 155 1/26/2025
1.0.0-beta-4 111 1/20/2025
1.0.0-beta-3 99 1/18/2025
1.0.0-beta-2 92 1/18/2025
1.0.0-beta-1 117 1/8/2025
1.0.0-alpha-2 91 1/7/2025
1.0.0-alpha-1 92 1/7/2025