OmniChat 2.0.4
dotnet add package OmniChat --version 2.0.4
NuGet\Install-Package OmniChat -Version 2.0.4
<PackageReference Include="OmniChat" Version="2.0.4" />
<PackageVersion Include="OmniChat" Version="2.0.4" />
<PackageReference Include="OmniChat" />
paket add OmniChat --version 2.0.4
#r "nuget: OmniChat, 2.0.4"
#:package OmniChat@2.0.4
#addin nuget:?package=OmniChat&version=2.0.4
#tool nuget:?package=OmniChat&version=2.0.4
OmniChat
Omnichannel chat SDK for .NET. Connect Telegram, Slack, Google Chat and Microsoft Teams with a single package — no server deployment needed.
Install
dotnet add package OmniChat
Usage
using OmniChat;
var sdk = new OmniChatBot();
sdk.UseTelegram("your-bot-token");
// sdk.UseSlack("xoxb-bot-token", "xapp-app-token");
// sdk.UseGChat(serviceAccountKey: "/path/to/service-account.json");
// sdk.UseTeams("your-app-id", "your-app-password");
sdk.OnMessage(async (thread, msg) =>
{
Console.WriteLine($"[{msg.Platform}] {msg.Author.UserName}: {msg.Text}");
await thread.ReplyAsync($"You said: {msg.Text}");
});
sdk.OnMention(async (thread, msg) =>
{
await thread.ReplyAsync($"Hey {msg.Author.UserName}! You mentioned me.");
});
using var cts = new CancellationTokenSource();
Console.CancelKeyPress += (_, e) => { e.Cancel = true; cts.Cancel(); };
await sdk.StartAsync(cts.Token);
Live-updating replies (tracked messages)
For streaming AI output, don't wait for the full response before showing anything — send once, then rewrite that same message in place as more text arrives:
var handle = await thread.ReplyTrackedAsync("Thinking"); // appears immediately
await thread.UpdateReplyAsync(handle, "Thinking about it..."); // rewrites the same message
await thread.UpdateReplyAsync(handle, "Here's the full answer.");
This avoids a chat platform showing "not responding" during long generations, and avoids leaving a stray "Thinking..." message behind — there's only ever one message, and it's rewritten as it grows.
Support varies by platform:
| Platform | ReplyTrackedAsync |
UpdateReplyAsync |
|---|---|---|
| Google Chat | ✅ | ✅ — PATCH messages.update |
| Slack | ✅ | ✅ — chat.update |
| Telegram | ✅ | ✅ — editMessageText |
| Microsoft Teams | ✅ | ✅ — Bot Framework activity update |
| ✅ (returns a real message id) | ❌ throws NotSupportedException — the Cloud API has no endpoint to edit a sent message |
Supported Platforms
| Platform | Method | How it works |
|---|---|---|
| Telegram | UseTelegram(botToken) |
Long polling — no public URL needed |
| Slack | UseSlack(botToken, appToken) |
Socket Mode — no public URL needed |
| Google Chat | UseGChat(serviceAccountKey, port, path, uploadAsUser) |
HTTP webhook + service-account app auth |
| Microsoft Teams | UseTeams(appId, appPassword) |
HTTP webhook + Azure OAuth2 |
Credentials
| Platform | What you need | Where to get it |
|---|---|---|
| Telegram | Bot Token | Talk to @BotFather on Telegram |
| Slack | Bot Token + App Token | api.slack.com — enable Socket Mode |
| Google Chat | Service account JSON key (+ HTTPS endpoint registered in the Chat API config) | console.cloud.google.com — enable the Chat API, configure the app, create a service account |
| Microsoft Teams | App ID + App Password | portal.azure.com — Register a Bot |
Google Chat file attachments (SendFileAsync) additionally need uploadAsUser set to a Workspace user your service account has domain-wide delegation for — the Chat API's attachment upload endpoint only accepts user authentication, not the app (service-account) authentication used for text messages.
Requirements
- .NET 8, 9 or 10
- No server deployment needed
- No database needed
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. 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 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. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.