I built an AI that watches cricket for you
Posted on March 28, 2026 in tech • 3 min read
The IPL is back, and with it comes the familiar dilemma: there are too many matches, and too little time. I wanted to catch every last-ball finish, every batting collapse, every explosive spell—but I also have a day job and two kids to handle.
So the developer in me did what it would do: he built a bot to do the cricket watching for me.
This is the story of how I created an AI‑powered Telegram bot that tracks live T20 matches, predicts excitement levels using machine learning, and alerts subscribers only when something worth watching is happening.
The Idea The problem was simple: cricket fans are busy, but they don’t want to miss the best moments. Existing score apps give you notifications for every boundary or wicket—that’s noise, not signal. I wanted a smart curator that could differentiate between a routine over and a game‑changing moment.
The idea: a system that monitors all live T20 matches in real time, runs each match through a machine learning model trained to detect “excitement”, and sends a Telegram alert when something thrilling is about to happen or is already underway.
The Build Process Data & Training: I scraped ball‑by‑ball data from public cricket APIs and labeled “exciting” moments—close finishes, hat‑tricks, rapid scoring—to create a training set. The excitement score is a composite of win‑probability swings, run‑rate acceleration, and wicket clusters.
The ML Model: A sequence‑based LSTM model consumes live ball‑by‑ball data and outputs a real‑time excitement score (0–100). It’s retrained daily with new matches to stay accurate.
Real‑Time Pipeline: A Python service polls cricket APIs 24/7 for live matches, feeds each ball update into the model, and triggers alerts when the excitement threshold is crossed.
Telegram Delivery: Alerts are sent instantly via the Telegram Bot API to subscribers—no app install needed.
Architecture The bot is built with simplicity and reliability in mind. Here’s a high‑level overview of the components:

Data Fetcher: Asynchronous worker that polls SportsMonks API for real time cricket scores with rate limiting.
Match Tracker: Maintains an in‑memory store of active matches, their current state, and a rolling buffer of recent ball‑by‑ball events.
ML Predictor: A Flask microservice that hosts the trained LSTM model. The tracker sends each match’s current feature vector to this service, which returns an excitement score.
Alert Engine: Applies contextual thresholds (e.g., lower threshold for low‑scoring matches, higher for run‑fests) to decide whether to fire an alert. It also prevents duplicate alerts for the same event.
Telegram Bot: Handles user subscriptions, manages channel membership, and sends formatted alerts.
All components are containerised with Docker and run on a small cloud instance. A cron job triggers the daily model retraining pipeline.
Final Thoughts Building this bot was a fun way to combine my love for cricket with machine learning and real‑time systems. It’s a reminder that side projects don’t have to be huge—they just need to solve a real problem you care about.
If you’re a cricket fan who wants to catch every thriller without the time sink, join this channel: