What This Bot Does
A user sends your Telegram bot a message. Within 2 to 3 seconds, they get an intelligent reply powered by DeepSeek AI. No human needed. It works in English, Pidgin, Yoruba, whatever language the person writes in. The bot detects it and responds accordingly.
It also sends a typing indicator so the person sees "Bot is typing..." just like a real conversation. If anything breaks, you get an instant alert on your personal Telegram so you know within seconds.
How I Built It (7 Nodes Total)
Here is the architecture:
1. Telegram Trigger
Listens for every incoming message to your bot via webhook. Photos, stickers, text, it catches everything.
2. Normalize Incoming Text
Extracts the message text, chat ID, user name, and language code into clean fields. If any value is missing, it falls back to a safe default instead of crashing.
3. Guard Empty Message
Filters out non text messages like images and stickers before they hit the AI. Without this, sending a photo to your bot would cause an error.
4. Typing Indicator
Sends "typing..." to the user so the experience feels natural and responsive.
5. Route User Command
A Switch node with three paths. /start triggers a welcome message. Regular text goes to the AI. Unknown slash commands get a friendly fallback response.
6. DeepSeek LLM Chain
The brain of the operation. A Basic LLM Chain connected to DeepSeek Chat Model. The system prompt injects the user name and language code so every reply is personalized and localized.
7. Error Handler
If anything fails anywhere in the flow, an Error Trigger fires a Telegram message to my admin chat with the execution ID and timestamp.