CSharpEssentials.LoggerHelper.Sink.Telegram
5.2.10
See the version list below for details.
dotnet add package CSharpEssentials.LoggerHelper.Sink.Telegram --version 5.2.10
NuGet\Install-Package CSharpEssentials.LoggerHelper.Sink.Telegram -Version 5.2.10
<PackageReference Include="CSharpEssentials.LoggerHelper.Sink.Telegram" Version="5.2.10" />
<PackageVersion Include="CSharpEssentials.LoggerHelper.Sink.Telegram" Version="5.2.10" />
<PackageReference Include="CSharpEssentials.LoggerHelper.Sink.Telegram" />
paket add CSharpEssentials.LoggerHelper.Sink.Telegram --version 5.2.10
#r "nuget: CSharpEssentials.LoggerHelper.Sink.Telegram, 5.2.10"
#:package CSharpEssentials.LoggerHelper.Sink.Telegram@5.2.10
#addin nuget:?package=CSharpEssentials.LoggerHelper.Sink.Telegram&version=5.2.10
#tool nuget:?package=CSharpEssentials.LoggerHelper.Sink.Telegram&version=5.2.10
CSharpEssentials.LoggerHelper.Sink.Telegram
Telegram bot notifications with MarkdownV2 formatting and throttling for CSharpEssentials.LoggerHelper.
Part of the CSharpEssentials.LoggerHelper ecosystem — install only the sinks you need.
Install
dotnet add package CSharpEssentials.LoggerHelper
dotnet add package CSharpEssentials.LoggerHelper.Sink.Telegram
Get a bot token and your chat id (3 minutes)
- Create the bot: in Telegram, open @BotFather, send
/newbot, pick a name and a username ending inbot. BotFather replies with the bot token (123456789:AAH...). Keep it secret: whoever has it controls the bot. - Write to the bot first: open the chat with your bot and press Start (or send
/start). A bot cannot message someone who never wrote to it. - Read your chat id: open
https://api.telegram.org/bot<TOKEN>/getUpdatesin the browser and look for"chat":{"id":123456789,...}. That number is the ChatId.- Empty
"result":[]? Send another message to the bot and reload. - For a group: add the bot to the group, write a message there, reload. Group ids are negative (
-100...).
- Empty
Keep the token out of source control, e.g. with user-secrets in development:
dotnet user-secrets set "LoggerHelper:Sinks:Telegram:BotToken" "123456789:AAH..."
dotnet user-secrets set "LoggerHelper:Sinks:Telegram:ChatId" "123456789"
User-secrets apply when you call AddLoggerHelper(builder.Configuration) and no appsettings.LoggerHelper.json (or appsettings.LoggerHelper.debug.json in Development) sits in the working directory. If one of those files exists, it replaces builder.Configuration: set the environment variables LoggerHelper__Sinks__Telegram__BotToken and LoggerHelper__Sinks__Telegram__ChatId instead.
Quick Setup — JSON
{
"LoggerHelper": {
"ApplicationName": "MyApp",
"Routes": [
{ "Sink": "Telegram", "Levels": ["Error", "Fatal"] }
],
"Sinks": {
"Telegram": {
"BotToken": "123456:ABC-DEF...",
"ChatId": "-100123456789"
}
}
}
}
builder.Services.AddLoggerHelper(builder.Configuration);
Quick Setup — Fluent API
builder.Services.AddLoggerHelper(b => b
.WithApplicationName("MyApp")
.AddRoute("Telegram", LogEventLevel.Error, LogEventLevel.Fatal)
.ConfigureTelegram(t => {
t.BotToken = "123456:ABC-DEF...";
t.ChatId = "-100123456789";
})
);
Configuration Options
| Property | Type | Default | Description |
|---|---|---|---|
BotToken |
string |
"" |
Required. Telegram Bot API token |
ChatId |
string |
"" |
Required. Target chat/group/channel ID |
ThrottleInterval |
TimeSpan? |
1 second | Minimum interval between messages |
Required:
BotTokenandChatId. If theTelegramsection is missing or one of them is empty, the sink fails to configure (InvalidOperationException), LoggerHelper records it as not configured (FAILED in the Dashboard/MCP) and the other sinks keep working.
Messages are formatted with MarkdownV2 and include emoji indicators per level:
- Information:
INFO - Warning:
WARNING - Error / Fatal:
ERROR/FATAL
Links
| 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
- CSharpEssentials.LoggerHelper (>= 5.2.10)
-
net8.0
- CSharpEssentials.LoggerHelper (>= 5.2.10)
-
net9.0
- CSharpEssentials.LoggerHelper (>= 5.2.10)
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 |
|---|---|---|
| 5.5.0 | 334 | 10/25/2026 |
| 5.4.0 | 110 | 10/16/2026 |
| 5.3.3 | 118 | 10/16/2026 |
| 5.3.2 | 106 | 10/11/2026 |
| 5.3.1 | 109 | 10/10/2026 |
| 5.3.0 | 102 | 10/10/2026 |
| 5.2.11 | 100 | 10/9/2026 |
| 5.2.10 | 107 | 10/7/2026 |
| 5.2.9 | 106 | 10/6/2026 |
| 5.2.8 | 109 | 10/6/2026 |
| 5.2.7 | 100 | 10/6/2026 |
| 5.2.6 | 150 | 8/31/2026 |
| 5.2.4.1 | 128 | 8/27/2026 |
| 5.2.4 | 144 | 8/25/2026 |
| 5.2.3 | 140 | 8/25/2026 |
| 5.2.2.9 | 163 | 7/11/2026 |
| 5.2.2.8 | 136 | 7/11/2026 |
| 5.2.2.7 | 151 | 7/10/2026 |
| 5.2.2.6 | 140 | 7/6/2026 |
| 5.2.2.5 | 132 | 7/5/2026 |