Skip to content
← All articles
8 min read

Telegram booking bot: slots, reminders and double-booking protection

A Telegram booking bot rests on four things: a schedule with service durations, picking a free slot, confirmation with reminders, and double-booking protection in the database. Everything else is convenience. Below is how it works, where it usually breaks, and what to decide before development: time zones, cancellations, rescheduling and calendar sync.

What an appointment booking bot has to do

A minimal booking bot does one job: the client picks a service, a date and a time, and the owner gets a confirmed booking with no calls or back-and-forth. Everything around it decides whether it is pleasant to use or falls over under real load.

Before writing code, pin down the scenarios: who books (new or returning clients), whether there are several specialists or rooms, whether a prepayment is needed, whether a client can book several services in a row. These answers shape the data model, and changing it after launch is the most expensive kind of rework.

  • Choosing a service and, if needed, a specialist.
  • Showing only slots that are really free.
  • Booking confirmation and a notification to the owner or admin.
  • A reminder to the client before the visit.
  • Cancel and reschedule by the client within the rules.
  • A list of bookings for the owner: by day, by week, by specialist.

How to calculate free slots

A slot is not a row in a "times" table. It is the result of a calculation: a specialist's working hours, minus existing bookings, minus breaks, taking the duration of the chosen service and any buffer between clients into account. Pre-generating every slot a year ahead is awkward, because any schedule change forces a recalculation.

It is more practical to store rules (working hours by weekday, exceptions, time off) and bookings as start-end intervals, and compute free windows on request. A 90-minute service must not fit into a 60-minute gap, so duration takes part in the calculation, not just the start time.

  • Schedule rules: working hours, breaks, days off, time off and one-off exceptions.
  • Service duration and a buffer before the next client.
  • Bookings stored as start-end intervals, not only a start time.
  • A configurable slot grid step, for example every 15 or 30 minutes.
  • A minimum lead time, so nobody books "in five minutes".

Time zones when clients are in different cities

Telegram does not tell a bot the user's time zone: it is not part of the data a bot receives. So a bot either assumes everyone lives on the business's local time, or asks explicitly. For on-site services the first option is usually right: bookings use the venue's local time and the bot always states which time a meeting is set in.

If services are online and clients are in different cities, ask for the zone at the first booking and save it. Store the booking time in UTC together with the business's zone name (for example `Europe/Berlin`), not an offset: offsets change with daylight saving where it exists. Show the client the time in their zone and put the zone into the confirmation text.

Protecting against double booking

Double booking happens when two clients choose the same slot at once: both see it free, both press the button. A "is it free?" check in code before the insert does not protect you, because time passes between the check and the write, and the second booking goes through.

Reliable protection lives in the database. PostgreSQL has an exclusion constraint on time ranges: the database itself rejects a second booking that overlaps the first for the same specialist. The bot gets an error and tells the client "that slot was just taken, pick another time". Then a race between two taps cannot put two clients at the same time.

  • A database-level rule: overlapping intervals for one specialist are not allowed.
  • Idempotency: a repeated button tap or a redelivered update must not create a second booking. See idempotency and retries.
  • A short hold on a slot during confirmation or payment, released automatically by a timer.
  • A clear message if the slot is taken, with the nearest free ones offered right away.

Cancelling and rescheduling

Cancellation rules are best settled before development because they affect both the interface and the data. Can a client cancel an hour before? Can they reschedule endlessly? What happens to a prepayment? The bot has to know the rules and give the client a clear answer instead of silently refusing.

Technically, rescheduling is cancelling the old booking and creating a new one in a single transaction: if the new slot is taken, the old booking stays. Keep history: a booking status (confirmed, cancelled by client, cancelled by admin, no-show) rather than deleting rows. That data helps with statistics and with disputes.

Reminders that actually arrive

A bot can only message a user after that user has started a conversation with it. So booking has to happen inside the bot, not by a phone number alone. If a client blocks the bot, the message will not arrive: handle that case instead of treating the reminder as sent.

It is better to store reminders as tasks with a due time in the database and process them with a background worker that picks up due tasks, sends the message and records the result. That way reminders survive a bot restart and don't get lost. Building such queues in Go is covered in background jobs and queues. When a booking is moved or cancelled, the reminder has to be cancelled or recreated.

  • Reminders as database tasks with a due time and a status.
  • Cancel or recreate the reminder when a booking changes.
  • Handle the "user blocked the bot" error and mark it on the booking.
  • Telegram limits how fast a bot can send: bulk sends need pauses between messages.
  • A button in the reminder: confirm or cancel.

Calendar sync and other systems

If a specialist keeps their schedule in Google Calendar or another tool, you need to decide which one is the source of truth. One-way sync (the bot writes to the calendar) is simple and reliable. Two-way sync (calendar changes affect the bot's slots) is useful but requires conflict resolution and careful handling of recurring events.

If bookings also need to reach a CRM, pass them on from the same transaction or through a queue. How that works is in bot and CRM for leads. The general dialog mechanics are in conversation state in a Telegram bot.

What to decide before development

Booking looks simple but hides many decisions that are hard to change later: one specialist or several, whether a prepayment is needed, the cancellation rules, one time zone or many, where the schedule comes from. List them and decide before the first screen. That saves the most time.

If you want more than buttons, look at Telegram Mini Apps: date buttons work for short lists, while a dense schedule is clearer in a calendar inside a mini app. What drives the price of such a bot is covered in Telegram bot development cost.

Questions

FAQ

Didn't find an answer — ask on the call or in Telegram.

How do I build a Telegram bot for booking appointments?

You need a schedule model (working hours, services, durations), free slot calculation, booking confirmation, reminders and database-level protection against double booking. Buttons are enough for a simple case; for a dense schedule, add a mini app with a calendar.

How do I prevent double booking?

A check in code is not enough: two clients can tap at the same time. The reliable way is a database constraint (in PostgreSQL, an exclusion constraint on time ranges) that refuses to save overlapping bookings for one specialist. The bot then asks the client to pick another time.

How does a bot know the client's time zone?

It does not: Telegram gives a bot user data without a time zone. For on-site services, book in the venue's local time and say so in the confirmation. For online services, ask for the zone at the first booking and save it.

Can reminders fail to arrive?

Yes. A bot can only message someone who started a conversation with it, and if a client blocks the bot, the message will not be delivered. The bot should handle that error and record it. That is why booking inside Telegram is more reliable than by a phone number alone.

Can a booking bot sync with Google Calendar?

Yes. The simple option is one-way: the bot creates events in the calendar. Two-way sync, where the calendar affects free slots, is harder: it needs conflict resolution and handling of recurring events.

Related service

Telegram bot development for business

A bot is a way into your system in the place where customers and staff already talk. We build bots as full applications — with a database, permissions and integrations — not as a set of buttons.

Learn about the service
Other articles
Contact

Shall we discuss your task?

Thirty minutes on a call — and you understand the architecture, timeline and engagement format. No obligations.

Or message us on Telegram →Follow our Telegram channel →

Enter your Telegram or email so we can reply.

We reply within 15 minutes.