Skip to main content

Framework/toolkit for building Telegram bots with telebot and redis

Project description

telebot-components

Framework / toolkit for building bots with telebot.

Development

Setup

  1. Clone repository

    git clone git@github.com:bots-against-war/telebot-components.git baw
    cd ./baw
    
  2. The project requires Poerty 1.2.x or higher (see installation instruction)). For example, to install 1.2.0b2 on Unix, run

    curl -sSL https://install.python-poetry.org | python3 - --version 1.2.0b2
    
  3. 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 plugin add poetry-dynamic-versioning-plugin
      
    • To create virtualenv inside the project’s root directory, use command
      poetry config virtualenvs.in-project false --local
      
  4. Run pre-commit to set up git hook scripts

    pre-commit install
    

Testing

Use command below for run tests

poetry run pytest tests -vv

By default, all tests are run with in-memory Redis emulation. But if you want you can run them locally on real Redis (read manual below)

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:

  1. Use command below to generate environment variables file:
    cp ./examples/example.env ./examples/.env
    

    Note: After .env file is generated you will need to add your bot's token to it.
    Also for bot with trello integration you need to add trello token and api key. You can get it here.

  2. 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
    
  3. Run any bot from ./examples
    python3 ./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

telebot_components-0.4.10.tar.gz (69.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

telebot_components-0.4.10-py3-none-any.whl (79.3 kB view details)

Uploaded Python 3

File details

Details for the file telebot_components-0.4.10.tar.gz.

File metadata

  • Download URL: telebot_components-0.4.10.tar.gz
  • Upload date:
  • Size: 69.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for telebot_components-0.4.10.tar.gz
Algorithm Hash digest
SHA256 73822ae43a40fae3abeafd2e6ad9695e6278f4d7c69df60bc98db14ee0c348c5
MD5 b725f4ad01a5d3480ac26ad07b3c0dd0
BLAKE2b-256 06cfc075fb7a3b7b9472207900d25fa00ef95d14b0fab1431ba613afc345c31e

See more details on using hashes here.

File details

Details for the file telebot_components-0.4.10-py3-none-any.whl.

File metadata

File hashes

Hashes for telebot_components-0.4.10-py3-none-any.whl
Algorithm Hash digest
SHA256 741cb3e1fd04696c3037da555cdfcd72da4a3362b17c9693f475a5de0f2d5f3c
MD5 2b56ae9c71012d4d66c342d2a3cce63f
BLAKE2b-256 4501136d54a2007e1f6110a457a829cb61f08bad2707dac5f1f7cd92b117e73b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page