JLOrdaz.TelegramBotMessage
2.0.2
dotnet add package JLOrdaz.TelegramBotMessage --version 2.0.2
NuGet\Install-Package JLOrdaz.TelegramBotMessage -Version 2.0.2
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="JLOrdaz.TelegramBotMessage" Version="2.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JLOrdaz.TelegramBotMessage" Version="2.0.2" />
<PackageReference Include="JLOrdaz.TelegramBotMessage" />
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 JLOrdaz.TelegramBotMessage --version 2.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: JLOrdaz.TelegramBotMessage, 2.0.2"
#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 JLOrdaz.TelegramBotMessage@2.0.2
#: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=JLOrdaz.TelegramBotMessage&version=2.0.2
#tool nuget:?package=JLOrdaz.TelegramBotMessage&version=2.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
JLOrdaz.TelegramBotMessage
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.
Features
- 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
Target Frameworks
netstandard2.1net10.0
Installation
Install the package from NuGet:
Install-Package JLOrdaz.TelegramBotMessage
or with the .NET CLI:
dotnet add package JLOrdaz.TelegramBotMessage
Quick Start
using 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.");
API Overview
TelegramNotifier
Main entry point for sending notifications to a Telegram chat.
Constructor
new TelegramNotifier(string botToken, string chatId)
Methods
SendMessageAsync(string message, CancellationToken cancellationToken = default)SendInfoMessageAsync(string message, CancellationToken cancellationToken = default)SendWarningMessageAsync(string message, CancellationToken cancellationToken = default)SendErrorMessageAsync(string message, CancellationToken cancellationToken = default)
Notes
- 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.
Version
- Current version:
2.0.0 - This version introduces breaking changes from earlier releases
Package
- Author: Jose Luis Ordaz
- Repository: https://github.com/JLOrdaz/JLOrdaz.TelegramBotMessage
- NuGet: https://www.nuget.org/packages/JLOrdaz.TelegramBotMessage
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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 was computed. 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 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- System.Text.Json (>= 10.0.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.