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
-
(Optional.) Create and set up new virtualenv for the project.
-
Install requirements from
requirements.txt
by runningpip install -Ur requirements.txt
. -
Create
config.yaml
in root project directory or in~/.config/spin_everyday_bot/2.x/
. -
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: ...
-
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!
-
Make sure the project is set up and up-to-date.
-
Install additional requirements from
requirements-dev.txt
. -
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
-
-
Run some tools to make code style better
isort spin_everyday_bot black -l 99 -t py39 spin_everyday_bot
-
Commit and push changes to your branch/fork.
-
Create a pull request.