This project contains an asynchronous telegram bot interface to easily manage the birthdays of your family, friends and acquaintances.
- All telegram users who use the bot has their own database table and can manage only their own list by the telegram bot interface.
- Easy add or remove persons to your personal list.
- View your entire personal list of people.
- Ability to see who has a birthday today, within a week or within a month.
- A scheduler that will run at the specified time then the bot starts checking all users for the presence of people whose birthday is today and exactly 7 days later, after which it sends a message with a reminder of this.
- Fully asynchronous.
Ilya Malashenko (github: melax08)
- Python 3.11;
- Docker (19.03.0+) with docker compose for easy run.
Via docker
Clone the repo and change directory to it:
git clone https://github.com/melax08/birthdaygram.git
cd birthdaygram
Copy file .env.example
to .env
and fill it in
cp .env.example .env
nano .env
Run docker compose
to create needed containers:
docker compose up -d
Without docker
There is no information yet.
All bot constants you can find in src/bot/constants/constants.py
.
Some of them you can set in .env
file (see example in .env.example
file).
Scheduler settings
At the specified time, the scheduler runs a task to check all tables in the database for records of people whose birthday is today or exactly 7 days from now. Those who have these people added to the database will receive a telegram message with information about birthdays.
You can set a RUN_SCHEDULER_HOURS
constant in the file .env.
Example:
RUN_SCHEDULER_HOURS=12 18
The scheduler tasks will be added to the queue when the bot starts. In this example, the scheduler will run at 12:00 (12:00 AM) and 18:00 (6:00 PM)
If you set RUN_SCHEDULER_HOURS
to the empty value (RUN_SCHEDULER_HOURS=
), the scheduler will not work.
Use pre-commit
to automatic application of black
, isort
, flake8
and other pre-commit hooks.
pre-commit install