agent-telegrambot
Agent TelegramBot
A TypeScript CLI tool that enables AI agents and humans to interact with Telegram using Bot API tokens (the kind issued by @BotFather). Unlike agent-telegram which authenticates as a real user account via TDLib, agent-telegrambot uses Telegram's HTTP Bot API — designed for server-side and CI/CD integrations.
Key Concepts
Before diving in, a few things about Telegram Bot integration:
- Bot tokens — Issued by talking to @BotFather inside Telegram. Format:
123456789:ABC-DEF1234ghIkl-zyx57W2v1u123ew11. Bot acts as its own bot account, with a username ending inbot. - Bot ≠ User — Bots cannot initiate DMs. The user must
/startthe bot first. In groups, bots receive only messages mentioning them or commands unless privacy mode is disabled in BotFather settings. - Chat IDs — Numeric IDs (positive for users, negative for groups, very negative for supergroups/channels). Channels can also be referenced by
@channelusername. - Real-time events — Available via the SDK's long-polling listener (
getUpdates), not via the CLI. Telegram Bot API does not support WebSockets. - Webhook vs polling — A bot can use webhooks OR long-polling, not both. The SDK listener auto-disables any active webhook before polling.
Quick Start
# Set your bot token (validates against Telegram)
agent-telegrambot auth set 123456789:ABC-DEF1234...
More from devxoul/agent-messenger
agent-slack
Interact with Slack workspaces - send messages, read channels, manage reactions
73agent-slackbot
Interact with Slack workspaces using bot tokens - send messages, read channels, manage reactions
70agent-discord
Interact with Discord servers - send messages, read channels, manage reactions
68agent-teams
Interact with Microsoft Teams - send messages, read channels, manage reactions
59agent-discordbot
Interact with Discord servers using bot tokens - send messages, read channels, manage reactions
42agent-telegram
Interact with Telegram through TDLib - authenticate, inspect chats, and send messages
8