JLOrdaz.TelegramBotMessage is a small library for sending notification messages to a Telegram chat from your applications.
This is a 2.0.0 release with breaking changes and a modern multi-target setup.
- Simple API for sending Telegram messages
- Built-in helpers for info, warning, and error notifications
async/awaitfriendly API- Cancellation support
- Safe MarkdownV2 escaping for message content
- Compatible with
netstandard2.1andnet10.0
netstandard2.1net10.0
Install the package from NuGet:
Install-Package JLOrdaz.TelegramBotMessageor with the .NET CLI:
dotnet add package JLOrdaz.TelegramBotMessageusing JLOrdaz.TelegramBotMessage;
var notifier = new TelegramNotifier("YOUR_BOT_TOKEN", "YOUR_CHAT_ID");
await notifier.SendMessageAsync("Hello from my app!");
await notifier.SendInfoMessageAsync("The deployment finished successfully.");
await notifier.SendWarningMessageAsync("Disk space is running low.");
await notifier.SendErrorMessageAsync("An unexpected error occurred.");Main entry point for sending notifications to a Telegram chat.
new TelegramNotifier(string botToken, string chatId)SendMessageAsync(string message, CancellationToken cancellationToken = default)SendInfoMessageAsync(string message, CancellationToken cancellationToken = default)SendWarningMessageAsync(string message, CancellationToken cancellationToken = default)SendErrorMessageAsync(string message, CancellationToken cancellationToken = default)
- The library formats messages using Telegram MarkdownV2 mode.
- Special characters are escaped automatically before sending.
- MarkdownV2 reserved characters are handled for standard notification text and timestamps.
- The public API is intentionally small and simple.
TelegramNotifierimplementsIDisposableand should be disposed when no longer needed.
- Current version:
2.0.0 - This version introduces breaking changes from earlier releases
- Author: Jose Luis Ordaz
- Repository: https://github.com/JLOrdaz/JLOrdaz.TelegramBotMessage
- NuGet: https://www.nuget.org/packages/JLOrdaz.TelegramBotMessage