Telegram Bot
The robomotion telegrambot CLI operates a Telegram bot for messaging and chat interaction. It sends text messages, photos, and documents; manages chats and members; handles inline keyboards; and processes incoming updates.
When to use
- Send text messages, photos, or documents to Telegram chats
- Manage chats, members, and chat settings
- Create inline keyboards for interactive bot responses
- Listen for and process incoming messages/updates
Prerequisites
robomotionCLI installed- Package installed:
robomotion install telegrambot - Telegram bot token configured via Robomotion vault
IMPORTANT: Session Mode Required for Multi-Step Operations
Each CLI command runs as a separate process — connection IDs from connect do NOT persist across calls.
You MUST use --session on connect and pass --session-id to all subsequent commands.
Workflow
- Install (once):
robomotion install telegrambot - Connect with session:
robomotion telegrambot connect --session --output json # → {"outClientId":"<client-id>","session_id":"<session-id>"} - Use the returned
client-idandsession-idin all subsequent commands:robomotion telegrambot send_message --client-id "<client-id>" --chat-id <chat> --text <text> --session-id "<session-id>" --output json - Disconnect when done:
robomotion telegrambot disconnect --client-id "<client-id>" --session-id "<session-id>" --output json
Always append --output json to get structured JSON results.
Commands Reference
robomotion telegrambot connect --session --output jsonConnect to Telegram using a bot tokenrobomotion telegrambot get_bot_info --client-id --session-id "<session-id>" --output jsonGet information about the connected Telegram botrobomotion telegrambot download_file --client-id --file-id --save-path --session-id "<session-id>" --output jsonDownload a file from Telegram to local storagerobomotion telegrambot get_file_path --client-id --file-id --session-id "<session-id>" --output jsonGet the file path for a Telegram filerobomotion telegrambot create_invite_link --client-id --0 --session-id "<session-id>" --output jsonCreate an invite link for a Telegram chatrobomotion telegrambot send_message --client-id --chat-id --message-text [--0] [--parse-mode] --session-id "<session-id>" --output jsonSend a text message to a Telegram chatrobomotion telegrambot receive_message [--0] [--0] --output jsonReceive and process incoming messages from a Telegram botrobomotion telegrambot forward_message --client-id --from-chat-id --to-chat-id --message-id --session-id "<session-id>" --output jsonForward a message from one Telegram chat to anotherrobomotion telegrambot disconnect --client-id --session-id "<session-id>" --output jsonDisconnect from Telegram and cleanup resourcesrobomotion telegrambot send_photo --client-id --chat-id --photo-url-or-path [--0] [--caption] --session-id "<session-id>" --output jsonSend a photo to a Telegram chatrobomotion telegrambot send_audio --client-id --chat-id --audio-url-or-path [--0] [--caption] [--file-name] [--mime-type] --session-id "<session-id>" --output jsonSend an audio file to a Telegram chatrobomotion telegrambot send_document --client-id --chat-id --document-path [--0] [--caption] [--file-name] [--mime-type] --session-id "<session-id>" --output jsonSend a document to a Telegram chat
Environment
- ROBOMOTION_API_TOKEN (if vault credentials are needed)