Skip to content

uburuntu/algebrach

Repository files navigation

🤖 Algebrach Bot, Remastered

Code style: black

https://t.me/algebrach_bot

Commands

  • /kek 😎

  • /kek_add to suggest a reply to be a kek

  • /kek_info to get stats

Previous implementation

Used technologies

Local development

Install Python 3.11

https://www.python.org/downloads/

Install dependencies

Using poetry (recommended):

poetry install --no-root

Or by using pip in a virtual environment (acceptable):

python3.11 -m venv ./venv
source ./venv/bin/activate
pip install -r requirements.txt

Or by using pip directly (not recommended):

pip3.11 install -r requirements.txt

Start the bot

From the algebrach/app/ folder:

# Set up tokens: copy .env.example to .env and edit it
cp .env.example .env
nano .env

To run:

# Replace `python` with `python3.11` if you didn't create virtual environment
python -u __main__.py

Used dev tools

Pre Commit hooks from .pre-commit-config.yaml file:

# To init (required only once)
pre-commit install --install-hooks

# To check hooks before commit
pre-commit run

Black Formatter with settings from pyproject.toml file:

# To format project files
black .

Ruff Linter with settings from pyproject.toml file:

# To detect linter issues and auto fix them where applicable
ruff check --fix .

# To run ruff in a watcher mode to check any file edit
ruff check --fix . --watch

Deploy on a server

Update to the latest revision:

git pull

Build and start Docker container:

docker-compose up --build -d --force-recreate