
Telegram bot that reminds you to ballot for ActiveSG activities
The ActiveSG Reminder Bot is a Telegram bot designed to facilitate the process of balloting for ActiveSG slots in Singapore. ActiveSG’s booking system uses a first-come-first-serve for non-peak slots and relies on balloting for peak hour slots. The bot does not automate booking and will not help with booking first-come-first-serve slots.
Instead, it sends a reminder whenever ballot slots have opened, along with a custom crafted URL that saves users a bit of time and clicking. Users can specify a given activity, venue, and timeslot, which the bot will use to generate a prefilled booking link. Rather than visiting the ActiveSG website, then having to manually select their preferred booking every time, users receive a prefilled link like this:
https://activesg.gov.sg/facility-bookings/activities/YLONatwvqJfikKOmB5N9U/venues/bbyJ7E5oIPvgA5J7jYNjN/timeslots?date=2025-11-23×lots=1763852400000The above link might look complicated, but all it does is prefill the selected information. The activity and venue IDs are encoded by ActiveSG, so YLONatwvqJfikKOmB5N9U corresponds to Badminton, and bbyJ7E5oIPvgA5J7jYNjN corresponds to Chua Chu Kang Secondary School Hall. The encoding of this information is handled by the bot, so all the user needs to do is click the reminder link, and be redirected to the booking page, where they will simply press a single button to confirm their ballot.
Behind the scenes, the bot is built using Cloudflare Workers and Typescript. Cloudflare Workers were chosen for their generous free tier, allowing for a healthy amount of HTTP requests, as well as scheduled handlers with cron, which were a good fit for the project. Unfortunately, Cloudflare Queues are only available on a paid plan, which represent a significant drawback. Currently, the bot uses a scheduled worker with cron to send out reminders at the start of every day. However, as a serverless function, the worker is limited by run and compute time, meaning that if the number of users grows too large, the bot may not be able to send all reminders in time. In any case, Cloudflare Queues would be a simple solution to this problem, and can be added as the userbase grows.