SpinEverydayBot v2

Telegram bot for everyday raffles. HIGHLY EXPERIMENTAL! WORK IN PROGRESS!

Setting up

Requirements

  • Python 3.9+
  • PostgreSQL 13+

Older versions might work, but not tested. If they do work, submit an issue.

Steps

  1. (Optional.) Create and set up new virtualenv for the project.

  2. Install requirements from requirements.txt by running pip install -Ur requirements.txt.

  3. Create config.yaml in root project directory or in ~/.config/spin_everyday_bot/2.x/.

  4. Open your config.yaml and edit it to match your setup.

    telegram:
      token: ...
      superuser_id: ...
    db:
      host: 127.0.0.1
      port: 5432
      user: ...
      database: ...
      password: ...
    
  5. Migrate database by running alembic upgrade head

Running

It's as easy as python -m spin_everyday_bot

Updating

Before you run a new version after updating, make sure your database is up-to-date by running migrations and check whether your config matches (see Setting up section for more info).

Contributing

Oh, you wanna contribute? That's nice!

  1. Make sure the project is set up and up-to-date.

  2. Install additional requirements from requirements-dev.txt.

  3. Make changes to the code.

    • If you made any changes to db, make sure you created a migration by running alembic revision --autogenerate -m '<description>' and verified it.

    • If you made any changes which require translation changes, make sure you generated a new translation template by running

      pybabel extract \
         --msgid-bugs-address="[email protected]" \
         --copyright-holder="Evgeniy Filimonov <[email protected]>" \
         --project=spin_everyday_bot --version=2.0.0-alpha.0 \
         -o spin_everyday_bot/lang/spin_everyday_bot.pot -w 99 \
         spin_everyday_bot
      
  4. Run some tools to make code style better

    isort spin_everyday_bot
    black -l 99 -t py39 spin_everyday_bot
    
  5. Commit and push changes to your branch/fork.

  6. Create a pull request.

GitHub

https://github.com/evgfilim1/spin_everyday_bot