CSharpEssentials.LoggerHelper.Sink.Telegram 5.2.11

There is a newer version of this package available.
See the version list below for details.
dotnet add package CSharpEssentials.LoggerHelper.Sink.Telegram --version 5.2.11
                    
NuGet\Install-Package CSharpEssentials.LoggerHelper.Sink.Telegram -Version 5.2.11
                    
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="CSharpEssentials.LoggerHelper.Sink.Telegram" Version="5.2.11" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CSharpEssentials.LoggerHelper.Sink.Telegram" Version="5.2.11" />
                    
Directory.Packages.props
<PackageReference Include="CSharpEssentials.LoggerHelper.Sink.Telegram" />
                    
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 CSharpEssentials.LoggerHelper.Sink.Telegram --version 5.2.11
                    
#r "nuget: CSharpEssentials.LoggerHelper.Sink.Telegram, 5.2.11"
                    
#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 CSharpEssentials.LoggerHelper.Sink.Telegram@5.2.11
                    
#: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=CSharpEssentials.LoggerHelper.Sink.Telegram&version=5.2.11
                    
Install as a Cake Addin
#tool nuget:?package=CSharpEssentials.LoggerHelper.Sink.Telegram&version=5.2.11
                    
Install as a Cake Tool

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)

  1. Create the bot: in Telegram, open @BotFather, send /newbot, pick a name and a username ending in bot. BotFather replies with the bot token (123456789:AAH...). Keep it secret: whoever has it controls the bot.
  2. 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.
  3. Read your chat id: open https://api.telegram.org/bot<TOKEN>/getUpdates in 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...).

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: BotToken and ChatId. If the Telegram section 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

Product 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. 
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
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
Loading failed