Conversational Telegram
Receives text or voice messages on Telegram, transcribes audio, and generates context-aware AI responses with a typing indicator.
What it does
Receive instant, context-aware replies to your text or voice messages directly inside Telegram without needing to switch apps. The agent transcribes your audio notes and generates thoughtful responses while showing a typing indicator so you know it is working.
Step by step
- Configure the Telegram Bot API token and set up a webhook or long-polling endpoint to receive updates.
- Implement voice message handling by downloading the file from Telegram's CDN before passing it to the transcription service.
- Format the final response payload according to Telegram's sendChatAction and sendMessage API specifications.
Where the LLM does the work
- Design system prompts that instruct the AI agent to maintain context across multiple turns in a conversation.
- Determine optimal temperature and top_p settings to balance creativity with factual accuracy for the specific use case.
- Generate error handling messages that gracefully inform users when the AI fails to produce a coherent response.
Watch out for
Tools that fit
The agent brief
You are helping me build the following AI agent workflow. ## Goal Conversational Telegram: Receives text or voice messages on Telegram, transcribes audio, and generates context-aware AI responses with a typing indicator. ## Specification - What it does: Receive instant, context-aware replies to your text or voice messages directly inside Telegram without needing to switch apps. The agent transcribes your audio notes and generates thoughtful responses while showing a typing indicator so you know it is working. - Trigger: Triggered by an event (Event · on new message) - Autonomy: Fully hands-off - Expected setup effort: about an afternoon - Tools/services involved: - Telegram: Messaging and triggers - OpenAI Chat Model: Text generation - Simple Memory: Context management ## Known pitfalls, handle each one explicitly in your implementation 1. Context windows fill up quickly during long chats so implement a sliding window strategy to keep memory usage manageable. ## Reference implementation https://n8n.io/workflows/4696 (workflow template) Fetch and inspect this before building. If it matches my stack, adapt it; if not, rebuild the pattern with my tools. ## Process requirements 1. Before building: ask me which of the listed tools I actually use and what my platform is (n8n / Make / code / other). Do not assume. 2. Adapt the pattern to my answers; do not force the reference stack. 3. Address every pitfall above; tell me how you handled each. 4. Provide a test plan I can run before letting this touch real data. 5. Ask before any step that sends messages, modifies data, or spends money. Source: https://usecasesforagents.com/use-case/conversational-telegram-bot/ via usecasesforagents.com
Frequently asked questions
Can I use a different Messaging than Telegram?
Yes. Telegram is only the example messaging in this recipe. The same flow works with ClickSend API, Discord, Google Chat and LINE Messaging API. Swap the messaging connection and keep the rest of the setup as written.
Want this running in your business?
Who it's for
Built for anyone who wants this off their own plate, no team or company required.
Developers can adapt this to their own repo or ticket queue with the same trigger and tools.