← back to case studies

AI · AUTOMATION

Telegram bot + AI automation

An LLM-assisted Telegram bot that automates weekly lesson scheduling, reminders, and teacher payment for a coding and robotics programme — without a human compiling it by hand.

result: Serves 50+ teachers, used daily in production

  • Telegram Bot API
  • Google Calendar API
  • Python
  • LLM-assisted dev

The Young Maker runs coding and robotics lessons across several venues, each on its own Google Calendar. Every week, someone had to manually read each calendar, compile the upcoming schedule into a reminder message for teachers, and separately tally up hours taught to calculate payment — a repetitive, error-prone job that ate into time better spent on the actual programme.

I built the first version myself: a Python bot (python-telegram-bot) that authenticates against Google Calendar via OAuth, reads across the programme's calendars, and posts a formatted weekly schedule and reminder straight into the team's group chat. It also reads the structured teacher/student details already embedded in each event's description to compute payment automatically and export it as a downloadable spreadsheet — turning a manual compilation job into a single command.

From there I used AI coding agents to extend it well beyond a read-only reminder tool: full lifecycle management for recurring courses, one-off workshops, teacher substitutions, and lesson postponements, all driven by conversational flows in Telegram. The interesting engineering problem wasn't the AI integration itself — it was making a bot trusted to directly mutate a shared production calendar safe enough that people were actually willing to let it write.

That's what the architecture is built around: nothing writes without an explicit confirmation step, every write is derived fresh from the calendar's current state rather than from stored assumptions, and a one-flag test mode made it possible to develop and demo new features against a throwaway calendar before ever touching production.

engineering highlights

  • Stateless, recompute-from-scratch design: lesson numbers and series membership are derived fresh from the live calendar every time, so nothing can quietly drift out of sync the way cached tracking state can.
  • A three-tier fallback for locating a course's events — a purpose-built tag, then the native recurring-event link, then a title/time-pattern match — so it keeps working even for events edited by hand directly in Google Calendar.
  • Every mutating action (creating, editing, deleting a lesson) runs through a shared Yes/No confirmation with a universal Cancel, and is restricted to an admin allowlist.
  • A TEST_MODE flag transparently redirects every read and write to a disposable calendar during development, so new features can be built and exercised with zero risk to real production data.