All projects

MarQuest · Telegram Bot + Mini App

PGDM Timetable Bot

Pythonpython-telegram-botMongoDBGoogle Sheets APITelegram Mini App

What it was

A Telegram bot and mini app that reads the live PGDM timetable sheet, works out each student's personal schedule across sections, groups and electives, and sends per-class reminders and change alerts automatically.

Key findings

The timetable sheet is private, so I built a one-admin login: I connect the sheet once through a Google OAuth page on marquest.in, the refresh token lands in the shared MongoDB, and the bot then reads the sheet for everyone. Students only send their name, and the bot works out their section from the roster and their electives and A or B group from each subject sheet, keyed on email because names in the sheets are inconsistently cased. It is about 2,400 lines of Python on python-telegram-bot, aiohttp and APScheduler, running in one asyncio loop alongside the Telegram mini app. Every 10 minutes it re-reads the sheet, diffs a snapshot of every dated cell against the last one, and messages only the students a change actually affects, so an edit to one elective group does not ping the other. College Google accounts sign out every week or so, so the bot detects the dead token, sends me a reconnect button, pauses notifications, and resumes on its own once I log back in. It runs under PM2 on the same server as marquest.in.

Full write-up coming soon