JLOrdaz.TelegramBotMessage
2.0.1
dotnet add package JLOrdaz.TelegramBotMessage --version 2.0.1
NuGet\Install-Package JLOrdaz.TelegramBotMessage -Version 2.0.1
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.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JLOrdaz.TelegramBotMessage" Version="2.0.1" />
<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.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: JLOrdaz.TelegramBotMessage, 2.0.1"
#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.1
#: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.1
#tool nuget:?package=JLOrdaz.TelegramBotMessage&version=2.0.1
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 | 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.
-
net10.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.