Preventing double bookings in a Telegram appointment bot using Python and SQLite
A developer describes how they built a small appointment bot for barbershops and salons that avoids double bookings without external services, relying only on SQLite. Rather than maintaining a table of slot availability that can go stale, the design stores only bookings and computes free slots on request based on working hours and service duration. An overlap check ensures a slot is free only if it does not conflict with any existing booking, and a final re-check inside a single transaction guards against races when the booking is written. Reminders are prevented from repeating through per-reminder flags, and the booking logic takes the current time as a parameter so it can be tested against an in-memory database. The author also mentions selling a complete bot template for $19 as a commercial offering.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in