Generative AIintermediate

Telegram Chatbot

A Telegram chatbot that provides conversational AI powered by an LLM (such as Gemini or GPT). Users interact through a familiar chat interface to receive AI-generated replies, while the system maintains continuity by injecting the context of the previous assistant response into each new prompt. This creates a fluid, "stateful" dialogue experience rather than a series of disconnected answers.

9 lectures

What You Will Learn

Master building Telegram bots using the aiogram framework with async/await patterns.
Implement message handlers for commands (/start, /help, /clear) and free-form chat.
Understand the integration of LLM for conversational AI.
Develop efficient asynchronous Python applications with long-polling.
Build a simple context management system using a Reference class for conversation continuity.

System Architecture

Telegram Chatbot Architecture Diagram

High-level architecture overview of the Telegram Chatbot .

What You'll Build

  • A "Tele Bot" — a conversational AI chatbot accessible via Telegram.
  • Command handlers for /start (welcome), /help (usage guide), and /clear (reset context).
  • A Reference-based context store that maintains the last assistant response for multi-turn coherence.
  • An Echo Bot (research/echo_bot.py) for testing Telegram connectivity without LLM integration.
Premium
One Subscription. 40+ Projects. Unlimited Access.
AccessMobile & Web