ControlAgentNet.Channels.Telegram
0.1.2
See the version list below for details.
dotnet add package ControlAgentNet.Channels.Telegram --version 0.1.2
NuGet\Install-Package ControlAgentNet.Channels.Telegram -Version 0.1.2
<PackageReference Include="ControlAgentNet.Channels.Telegram" Version="0.1.2" />
<PackageVersion Include="ControlAgentNet.Channels.Telegram" Version="0.1.2" />
<PackageReference Include="ControlAgentNet.Channels.Telegram" />
paket add ControlAgentNet.Channels.Telegram --version 0.1.2
#r "nuget: ControlAgentNet.Channels.Telegram, 0.1.2"
#:package ControlAgentNet.Channels.Telegram@0.1.2
#addin nuget:?package=ControlAgentNet.Channels.Telegram&version=0.1.2
#tool nuget:?package=ControlAgentNet.Channels.Telegram&version=0.1.2
ControlAgentNet.Channels.Telegram
<p align="center"> <img src="https://img.shields.io/github/license/ControlAgentNet/ControlAgentNet.Channels.Telegram" alt="License"> <img src="https://img.shields.io/github/actions/workflow/status/ControlAgentNet/ControlAgentNet.Channels.Telegram/ci.yml?branch=main" alt="CI"> <img src="https://img.shields.io/nuget/v/ControlAgentNet.Channels.Telegram" alt="NuGet Version"> </p>
Telegram bot channel for ControlAgentNet agents.
What This Repository Contains
This repository publishes the ControlAgentNet.Channels.Telegram package.
It adds a polling-based Telegram channel to a ControlAgentNet host application.
What It Does
This package connects Telegram bot messages to IAgentOrchestrator and sends agent responses back to Telegram chats.
Use it when you want:
- a Telegram bot interface for your agent
- polling-based operation without webhook hosting
- chat allow-listing through authorized chat ids
This repository does not include the base runtime itself. You still need the base packages from ControlAgentNet.Agents.
Installation
dotnet add package ControlAgentNet.Agents
dotnet add package ControlAgentNet.Channels.Telegram
Usage
using ControlAgentNet.Agents;
using ControlAgentNet.Channels.Telegram;
builder.Services.AddControlAgentAgent(builder.Configuration, builder.Environment, options =>
{
options.Id = "telegram-agent";
options.Name = "Telegram Agent";
options.Instructions = "You are a helpful assistant.";
})
.AddTelegramChannel();
Configuration
{
"ControlAgentNet": {
"Channels": {
"Telegram": {
"BotToken": "YOUR_BOT_TOKEN_FROM_BOTFATHER",
"AuthorizedChatIds": [123456789],
"PollingIntervalMs": 1000
}
}
}
}
Store the bot token in environment variables or secret stores, not in committed config files.
Configuration Options
| Property | Default | Description |
|---|---|---|
BotToken |
required for activation | Telegram bot token from @BotFather |
AuthorizedChatIds |
empty | Allowed chat ids. Empty means allow all chats |
PollingIntervalMs |
1000 | Polling interval in milliseconds |
Build
dotnet restore ControlAgentNet.Channels.Telegram.slnx
dotnet build ControlAgentNet.Channels.Telegram.slnx -c Release
dotnet test ControlAgentNet.Channels.Telegram.slnx -c Release --no-build
dotnet pack ControlAgentNet.Channels.Telegram.slnx -c Release -o artifacts/nuget --no-build
Sample
The repository includes samples/HelloWorld.Telegram to demonstrate the package with a local inline engine.
By default the sample starts with an empty bot token, so the Telegram channel remains installed but idle until you configure a real token.
Security
- configure
AuthorizedChatIdsin production whenever possible - keep the bot token out of committed config files
- if no bot token is configured, the channel remains idle
Versioning
- local builds:
0.1.2-dev - pull requests:
0.1.2-preview.<run_number> - pushes to
main:0.1.2-alpha.<run_number> - tags like
v0.1.2: exact stable package version0.1.2
See VERSIONING.md for the release flow.
| 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. |
-
net10.0
- ControlAgentNet.Core (>= 0.1.1)
- ControlAgentNet.Runtime (>= 0.1.1)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.5)
- Telegram.Bot (>= 22.9.6.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.