Skip to content

API Reference parrot.integrations.telegram.manager

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.integrations.telegram.manager

View source

Telegram Bot Manager.

Manages lifecycle of Telegram bots exposing AI-Parrot agents. Loads configuration from {ENV_DIR}/telegram_bots.yaml and starts aiogram polling for each configured bot.

Alias AbstractBot

Re-exported from parrot.bots.abstract.AbstractBot.

Alias BotManager

Re-exported from parrot.manager.BotManager.

Attribute ENV_DIR

Alias TelegramAgentConfig

Re-exported from parrot.integrations.telegram.models.TelegramAgentConfig.

Alias TelegramAgentWrapper

Re-exported from parrot.integrations.telegram.wrapper.TelegramAgentWrapper.

Class TelegramBotManager

Manages Telegram bot lifecycle for exposed agents.

Responsibilities:

  • Load configuration from {ENV_DIR}/telegram_bots.yaml
  • Get agent instances from BotManager using chatbot_id
  • Start aiogram polling in background tasks
  • Handle graceful shutdown
Parameter Type Default Description
bot_manager BotManager

Attributes:

Attribute Type Description
bots Dict[str, Tuple[Bot, Dispatcher, TelegramAgentWrapper]]

Method TelegramBotManager.load_config

Load telegram_bots.yaml from ENV_DIR.

load_config() -> Optional[TelegramBotsConfig]

Returns: Optional[TelegramBotsConfig] — TelegramBotsConfig if file exists and is valid, None otherwise.

Method TelegramBotManager.startup

Start all configured Telegram bots.

Called from BotManager.on_startup().

startup() -> None

Method TelegramBotManager.shutdown

Stop all Telegram bot polling tasks.

Called from BotManager.on_shutdown().

shutdown() -> None

Method TelegramBotManager.get_active_bots

Get names of currently active bots.

get_active_bots() -> List[str]

Returns: List[str]

Method TelegramBotManager.is_running

Check if a specific bot is running.

is_running(name: str) -> bool

Parameter Type Default Description
name str

Returns: bool

Alias TelegramBotsConfig

Re-exported from parrot.integrations.telegram.models.TelegramBotsConfig.

Alias discover_telegram_commands

Re-exported from parrot.integrations.telegram.decorators.discover_telegram_commands.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally