Messaging

RocketNet.Chat

Unofficial .NET SDK for Rocket.Chat

RocketNet.Chat version on NuGetRocketNet.Chat downloads on NuGetMITC#
netstandard2.0net8.0net10.0

Features

  • Find a user by username, email or id
  • Open the direct chat and post a message
  • Read room history and unread counters
  • Mark rooms read / unread
  • Custom emoji and absolute media URLs

Installation

bash
dotnet add package RocketNet.Chat

Quick start

csharp
using RocketNet.Chat;

using var httpClient = new HttpClient();

var client = new RocketChatClient(httpClient, new RocketChatClientOptions
{
    BaseAddress = new Uri("https://chat.example.com/"),
    UserId = "rbAXPnMktTFbNpwtJ",
    AuthToken = "RScctEHSmLGZ...",
});

// Look the user up, open the private chat and post into it — one call.
var posted = await client.SendDirectMessageAsync(
    RocketChatUserQuery.ByEmail("kim@example.com"),
    "Deploy finished ✅");

Console.WriteLine(posted.Message?.RoomId);

Key methods

SendDirectMessageAsyncFind, open the chat and post — in one call
FindUserAsyncFind a user
CreateDirectMessageAsyncOpen the private chat
PostMessageAsyncPost a message
GetHistoryAsyncRoom history
READMEgithub.com/ai-iskuzhin/RocketNet.Chat
Loading README from the repository…