Framework/toolkit for building Telegram bots with telebot and redis
Project description
telebot-components
Framework / toolkit for building bots with telebot.
Development
Setup
-
Clone repository
git clone git@github.com:bots-against-war/telebot-components.git cd telebot-components
-
The project requires Poerty 1.7.1 (see installation instruction). For example, to install
1.7.1on Unix, runcurl -sSL https://install.python-poetry.org | python3 - --version 1.7.1
-
Then, to install the library with all dependencies, run from project root
poetry install- You might need to manually install dynamic versioning plugin (without it local build will
always have version
0.0.0):poetry self add poetry-dynamic-versioning-plugin
- To create virtualenv inside the project’s root directory, use command
poetry config virtualenvs.in-project false --local
- You might need to manually install dynamic versioning plugin (without it local build will
always have version
-
Run
pre-committo set up git hook scriptspre-commit install
Testing
Use command below for run tests
poetry run pytest tests -vv
To also generate test coverage report
poetry run coverage run -m pytest tests -vv && poetry run coverage report
By default, all tests are run with in-memory Redis emulation. But if you want you can run them
locally on real Redis by specifying REDIS_URL environment variable before running pytest.
Note: Tests must be able to find an empty Redis DB to use; they also clean up after themselves.
Start example bot
For first start you need to do 3 things:
- Use command below to generate environment variables file:
cp ./examples/example.env ./examples/.env
Note: After
.envfile is generated you will need to add your bot's token to it.
Also for bot withtrello integrationyou need to addtrellotoken and api key. You can get it here. - If you want start redis on local machine, run
docker run --name baw-redis -d -p 6379:6379 redis redis-server --save 60 1 --loglevel warning
- Run any bot from
./examplespython3 ./examples/feedback_bot.py // or run with IDE from bot file
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file telebot_components-0.16.3.tar.gz.
File metadata
- Download URL: telebot_components-0.16.3.tar.gz
- Upload date:
- Size: 180.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
469650c8cd8362cbd2ca40b635d9c7ac1242bb21fd06d9d2d5608ec896953fcb
|
|
| MD5 |
8fa27e75f7f4afd902c07c8f43afbb58
|
|
| BLAKE2b-256 |
2ce807e49051972896cdd5ac20d22c948afb2159f59ffa9875b184b475d18516
|
File details
Details for the file telebot_components-0.16.3-py3-none-any.whl.
File metadata
- Download URL: telebot_components-0.16.3-py3-none-any.whl
- Upload date:
- Size: 198.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fc0ac02b983ccebe9172095d9725a2097975b3f67d33fb1f32f9449f1c617d1
|
|
| MD5 |
d5e82177cd91d93d76caffe8e6d64806
|
|
| BLAKE2b-256 |
b15e1b2a4af5a6854d2dea095f9b3d90e56bd8e5740d1f17438caf76f96b9aba
|