AI Telegram Assistant with Text & Voice Support Built with Make

Hi Makers! :waving_hand:

Why I built this

I needed a way to get quick AI answers without switching between apps. Telegram is where I already spend most of my time, so I wanted an assistant that could answer both typed questions and voice messages directly inside a chat.

Result: The bot now replies to text and voice messages within a few seconds, and it has been running since [2026.08.01] handling around [50] messages per day.


How the scenario works

1. Telegram → Watch Updates (trigger)

This module listens for every new message sent to the bot. It returns the full message object, which can contain either a text field or a voice field.

2. Router → two branches

I used a Router because text and voice need completely different handling. Each route has its own filter:

  • Route A (Text): filter → text exists
  • Route B (Voice): filter → voice exists

Without the Router, the scenario would try to transcribe text messages and fail.

3. Route B — Voice processing

  • Telegram → Get a File: Telegram only sends a file_id, not the audio itself, so this step retrieves the actual file path.
  • HTTP → Get a File: downloads the .oga audio as binary data.
  • converts the audio into text.

After this step, both routes carry plain text, so they can be merged into the same AI module.

4. AI response generation

The transcribed or typed text is sent to [نام مدل، مثلاً Google Gemini] with a system prompt that keeps answers short and conversational, because long replies are hard to read on mobile.

5. Telegram → Send a Message

The AI output is sent back to the same chat_id from the trigger, so the reply always lands in the correct conversation.


What I learned

  • Voice messages require two separate download steps in Telegram (get the file path, then download the file) — this is not obvious at first.
  • Putting the filter on the Router instead of inside each branch made the scenario much easier to debug.
  • Keeping the system prompt short noticeably reduced token usage and response time.

Scenario link

Hope this helps someone building something similar! :rocket:


Clean build, and the Router split for text and voice is the right call. Two things I’d add if it’s going to keep running:

  1. Limit who can use it. Right now anyone who finds the bot’s username can message it and spend your AI credits and operations. A filter right after the trigger that only lets through your own chat ID (or a short list of allowed IDs) fixes that.
  2. Add a fallback route. People will eventually send a photo, sticker or file. A third route with no filter (set as the fallback route) that replies “I can only handle text and voice for now” stops those runs from ending in errors.

If you want it to remember context, a Data Store keyed by chat ID holding the last few messages works well. You pass them into the AI module with each new question.

Thank you so much for taking the time to review this — these are genuinely useful suggestions.

On access control: You’re right, and this is the most important one. The bot is currently open to anyone who finds the username, which is a real risk for both credits and operations. I’ll add a filter right after the trigger that only allows a whitelist of chat IDs through.

On the fallback route: Good catch. I hadn’t accounted for photos, stickers or documents, and those runs would currently just fail. Adding a third unfiltered route set as the fallback with a simple “I can only handle text and voice for now” reply is a clean fix.

On conversation memory: This is exactly what I was missing. Using a Data Store keyed by chat ID to hold the last few messages and passing them into the AI module makes a lot of sense. I’ll experiment with how many messages to keep so the context stays useful without inflating token usage too much.

I’ll implement all three and update the post with the revised scenario.

Thanks again :folded_hands: