Alva.ServiceKit.TelegramBotService
3.1.2
dotnet add package Alva.ServiceKit.TelegramBotService --version 3.1.2
NuGet\Install-Package Alva.ServiceKit.TelegramBotService -Version 3.1.2
<PackageReference Include="Alva.ServiceKit.TelegramBotService" Version="3.1.2" />
<PackageVersion Include="Alva.ServiceKit.TelegramBotService" Version="3.1.2" />
<PackageReference Include="Alva.ServiceKit.TelegramBotService" />
paket add Alva.ServiceKit.TelegramBotService --version 3.1.2
#r "nuget: Alva.ServiceKit.TelegramBotService, 3.1.2"
#:package Alva.ServiceKit.TelegramBotService@3.1.2
#addin nuget:?package=Alva.ServiceKit.TelegramBotService&version=3.1.2
#tool nuget:?package=Alva.ServiceKit.TelegramBotService&version=3.1.2
ServiceKit.TelegramBotService
Send telegram message throught api.
For a description of the Bot API, see this page: https://core.telegram.org/bots/api
Get last messages https://api.telegram.org/bot{your key}/getUpdates
Registration in Program.cs
services.AddSingleton<ITelegramBotConfiguration>(Configuration.GetSection("TelegramBotConfiguration")
.Get<TelegramBotConfiguration>());
services.AddTransient<ITelegramBotSender, TelegramBotSender>();
Configuration in appsettings.json
Put your token and user ids in appsettings.json.
"TelegramBotConfiguration": {
"Token": "9999999999:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Chats": [
"99999999",
"99999999"
]
},
You can see your id from last messages throught thelegram api: https://api.telegram.org/bot{your key}/getUpdates
Methods
public Task SendTextAsync(string text);
public Task SendTextSafeAsync(string text);
public void SendText(string text);
public void SendTextSafe(string text);
Using
await telegramSender.SendTextSafeAsync(text);
Versions
2.0 - .net 6.0 3.0 - .net 8.0
| 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 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. |
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Telegram.Bot (>= 18.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Alva.ServiceKit.TelegramBotService:
| Package | Downloads |
|---|---|
|
Alva.ServiceKit.FileLoggerService
File-based logging service. Included in the general set of auxiliary libraries: Alva.ServiceKit.* |
GitHub repositories
This package is not used by any popular GitHub repositories.