Session 12 / 15🔎עב

In one sentence

Students bring the agent to real channels — Telegram with voice, WhatsApp, Slack — in a one-brain architecture.

Preparation before the session

Time plan

  1. 00:00–00:15 Review: the knowledge bot
  2. 00:15–00:45 Telegram in depth: commands, buttons, files
  3. 00:45–01:15 Voice: transcription and a spoken answer
  4. 01:15–01:30 ☕ Break
  5. 01:30–01:55 WhatsApp Business
  6. 01:55–02:15 Slack + a multi-channel architecture
  7. 02:15–02:50 Building together: a voice assistant
  8. 02:50–03:00 Summary and practice

Lecture parts and activity type

PartActivity type
Telegram in depthDemo
Voice: transcribe and answerSimulation
WhatsApp BusinessExplanation
Slack — the internal channelDemo
Architecture: one brain, many channelsDrawing the architecture

The 3 messages that must get across

  1. One bot = one entry.
  2. Voice = download → transcription → agent → reading aloud.
  3. One brain, many channels.

Questions for class discussion

  • Which channel are your customers really on?
  • When is a spoken answer better?
  • What does opt-in mean on WhatsApp?

Live demo script

A bot with commands and buttons

  1. Entry — Watch Updates → Router.
  2. /start — Filter text = /start → Send a Text Message + inline keyboard.
  3. callback — Filter callback_query.data Exists → an inner Router by data.
  4. Text — Fallback → Send "I got it".

Transcribing voice messages

  1. Filter — voice.file_id Exists.
  2. Download — Telegram Bot → Download a File → File ID.
  3. Transcription — OpenAI → Create a Transcription: File = voice.ogg + data, language set.
  4. Test — Send: "I heard: {{text}}".

A full voice AI assistant

  1. Combine — Set variables: input, replyMode.
  2. Agent — Run an agent with Input = input + replyMode.
  3. Router — voice → TTS → Send Audio; text → Send Text.

Problems students will run into

ProblemQuick fix
The button spins foreverAnswer the callback (Answer a Callback Query) or send a message.
The Chat ID is empty on a clickIt's under callback_query.message.chat.id.
Invalid file formatThe file name has no extension; add .ogg.
The transcription is in the wrong languageSet the language.
The voice can't be heard on TelegramSend Voice with MP3 — switch to Send Audio.
The answer is too longAn instruction + shortening.
The bot answers itself in a loopA filter on user / bot_id.
not_in_channelInvite the bot to the channel.

Tips from the classroom

  • A live voice message in class = a peak moment.
  • WhatsApp — show the process, don't get stuck on approvals.
  • Voice/Audio — explain it in advance.

Adapting to different levels

For students who struggle: Commands + buttons.

For fast students: Hub & spoke + rate limiting.

Answer key — multiple-choice questions

Students see the answers in shuffled order, so the key gives the wording of the right answer.

#Right answer
1A callback_query with data
2To show the bot is working during a slow action
3OGG/Opus
4The time you can reply freely after a customer message
5Reply in a thread
6One change for every channel
7A terms violation and a risk of being blocked
8Improves accuracy

Homework

  1. A working voice assistant.
  2. Preparing for session 13: think about your sales funnel — where leads come from, what happens to them, and where they "fall off".