πŸŽ‚

Birthday bot: reminders and a gift budget

our own product: friends and family add the dates, the admin gets the reminders

A Telegram bot where friends and family enter birthdays themselves, while the admin gets reminders 14, 7, 3 and 1 days ahead, a calendar and a gift budget forecast for 30, 90 and 365 days. Python, aiogram 3, SQLite.

In production Β· in-house product
14 / 7 / 3 / 1
days ahead plus the day itself: reminders come in advance, and the set of days is configurable
30 / 90 / 365
days ahead: how much to set aside for gifts, broken down by month for a year
1 file
the whole database is a single SQLite file: a backup is a copy of the file

The task

Birthdays of loved ones are easy to forget, and gifts cost money that is better set aside in advance. Usually the dates live in one person's head or in scattered notes, and nobody adds up the gift budget: the expenses hit all in one month.

What is needed is a shared list that friends and family fill in themselves, and a clear calculation for the one person who takes care of it. The administrator needs reminders in advance rather than on the day, and a number: how much to set aside for the coming months.

The solution

The birthday bot is the studio's own product: a Telegram bot that collects dates from any users, sends the administrator reminders and calculates a gift budget. What is implemented:

  • step-by-step entry creation with the /add command: name, a date as DD.MM or DD.MM.YYYY (the year is optional), a budget and a note;
  • a check that the date exists, including the number of days in the month;
  • /list: all entries ordered by how soon the date is, with age (if a year is given), budget and note, with β€œBudget” and β€œDelete” buttons under each;
  • /calendar: an interactive month calendar with birthdays marked and month navigation;
  • /budget, for the administrator only: totals for 30, 90 and 365 days, a month-by-month breakdown for a year ahead and a grand total;
  • a daily scheduled check and reminders to the administrator a configurable number of days ahead;
  • /cancel to abort a dialog, and a hidden /version command for the administrator;
  • Docker deployment with the database stored on the host's disk.

How it works

Step-by-step entry on an FSM in aiogram

An entry is created through a four-step dialog. It runs on an FSM (finite-state machine: the bot remembers which step a dialog with a particular person is on). The bot accepts a date with or without a year, checks that it exists, and the budget and note can be skipped with a β€œ-”. Dialog states are kept in memory, so an unfinished dialog starts over after a bot restart.

Daily reminders: APScheduler and a cron schedule

APScheduler is a task scheduling library. Once a day at a set time (9:00 Moscow time by default) it runs a check: if a date is 14, 7, 3 or 1 days away, or is today, the administrator gets a reminder. The list of days is set through an environment variable, where 0 means the day itself. The schedule's time zone is configured separately.

The gift budget by month

Each entry can carry its own budget. The /budget command adds up the budgets of dates that fall within a 30-, 90- or 365-day window (the window is switched with buttons) and spreads the total across the months of the coming year. The breakdown shows the β€œexpensive” months at once, when the most will go on gifts.

A calendar on inline buttons

The calendar is built from inline buttons right inside the message. Days with birthdays are marked with a cake icon, you can page through months, and tapping a number shows whose birthday it is. A 29 February birthday is marked on 1 March in a non-leap year.

SQLite in Docker: data survives a rebuild

SQLite is a database in a single file with no separate server. In Docker the database file is placed on the host's disk (a volume), so it survives a container rebuild. The container publishes no ports because the bot polls Telegram itself (long polling), has a 256 MB memory limit and log rotation. A backup is a copy of the file, preferably taken while the container is stopped.

Permissions: who can do what

Any user of the bot can add entries. The budget can be changed or an entry deleted by the administrator or by whoever added it. Reminders and /budget are seen only by the administrator, who is identified by an ID from the settings.

Results

  • Birthdays are collected by friends and family, not by a single person.
  • The administrator gets reminders in advance rather than on the day.
  • The gift budget is visible in numbers for 30, 90 and 365 days, broken down by month.
  • Data is kept in one file and survives a container restart.
  • The repository has no automated tests; acceptance is manual.

Technologies and why

  • Python and aiogram 3 β€” an asynchronous Telegram bot: commands, dialogs, inline buttons.
  • SQLite and aiosqlite β€” storing entries in one file, with async access that does not block the bot.
  • APScheduler β€” the daily check and reminder delivery on a schedule.
  • python-dotenv β€” the bot token, the administrator ID and reminder settings from the environment.
  • Docker Compose β€” running on a server with the database on the host's disk and a Moscow time zone in the container.

Status

Version 1.0.0 of 30 September 2026. The version is printed to the log on every start, and there is a hidden /version command. Known limitations: only the administrator receives reminders; the name, date and note cannot be edited after adding (only the budget and deletion); the list has to be reopened after deleting an entry; there are no schema migrations.

Questions about this project

How do I stop forgetting the birthdays of friends and family?
Friends and family add their dates themselves through a link to the bot, and the administrator gets reminders in advance. By default the bot writes 14, 7, 3 and 1 days before the date and on the day itself, at 9 a.m. Moscow time. The set of days and the time are configurable.
How can I plan a gift budget a year ahead?
When adding an entry you can set a gift budget. The /budget command, available to the administrator, totals the budgets for the next 30, 90 or 365 days and shows a month-by-month breakdown for a year ahead. That shows which months will cost the most.
Does the administrator have to enter dates manually?
No. Entries are added by anyone the administrator has given the bot link to. Adding goes step by step: name, date (the year is optional), budget and a note. The bot checks that the date exists and rejects, for example, 31.02.
Who sees the entries, and who sees the reminders and the budget?
All entries are visible to every user of the bot. Reminders and the /budget command are available only to the administrator. An entry can be deleted, or its budget changed, by the administrator or by whoever added it.
How is a birthday on 29 February handled?
In a non-leap year the bot marks that date on 1 March. There is also a month calendar: days with birthdays carry a cake icon, and tapping a number shows whose day it is.
What does the bot run on and where is the data stored?
The bot is written in Python with aiogram 3, data is kept in a SQLite file, and APScheduler runs the reminder schedule. For a server it is set up to run in Docker: the database is stored on the host's disk and survives a container rebuild.

Need something similar?

Tell us about the task β€” we'll show how we solved it and estimate the scope.