Giter VIP home page Giter VIP logo

birthdaygram's Introduction

birthdaygram workflow Code style: black

Birthdaygram - telegram bot for birthday reminders

birthdaygram_logo.png

Information

Description

This project contains an asynchronous telegram bot interface to easily manage the birthdays of your family, friends and acquaintances.

Features

  • 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.

bot_example.png

Author

Ilya Malashenko (github: melax08)

System requirements

  • Python 3.11;
  • Docker (19.03.0+) with docker compose for easy run.

Tech stack

Python Poetry Python-telegram-bot Postgres SQLAlchemy

Installation and start

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.

Settings and documentation

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.

For developers

Use pre-commit to automatic application of black, isort, flake8 and other pre-commit hooks.

pre-commit install

birthdaygram's People

Contributors

melax08 avatar

Stargazers

 avatar

Watchers

 avatar

birthdaygram's Issues

BOT_TIMEZONE - Ошибка

Ругается на BOT_TIMEZONE, прописывал в env и убирал все равно не помогает...
birthdaygram_birthdaygram_bot_1 exited with code 1 birthdaygram_bot_1 | Traceback (most recent call last): birthdaygram_bot_1 | File "/app/bot.py", line 4, in <module> birthdaygram_bot_1 | from bot.constants.constants import BIRTHDAYGRAM_LOG_NAME, BOT_TIMEZONE, TOKEN birthdaygram_bot_1 | File "/app/bot/constants/constants.py", line 27, in <module> birthdaygram_bot_1 | ECHO: int = int(os.getenv("ECHO", default=0)) birthdaygram_bot_1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ birthdaygram_bot_1 | ValueError: invalid literal for int() with base 10: ''

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.