Galaxy13 / telegramqrbot

Docker-deploy, Python 3, Telegram bot test
0 stars 1 forks source link

Test of CI/CD systems using Telegram Bot app

Python Project with cloud Docker packaging

This bot receives text message from end-user, remembers them, and send you back a QR-code.

Idea is cloud based application, which has to go through pytest, with using Travis CI for auto building and pulling app to Docker container.

To create the interaction between Telegram and local methods, was used a pyTelegramBotAPI 5.3 https://github.com/eternnoir/pyTelegramBotAPI

Installation

This bot requires Python 3 installation on your machine.

Use the package manager pip to install packages:

pip install qrcode
pip install pyTelegramBotAPI

After that just clone the repository:

wget clone https://github.com/Galaxy13/telegram_bot-Docker.test.git
cd telegram_bot-Docker.test

Usage

First, you need to create your Bot and get your Token from Bot Father and write it into token.txt

cd ...\telegram_bot-Docker.test\scratches
vim token.txt

You should put token in token.txt, you received, without other symbols. Example

Launch botMain.py:

python3 botMain.py

After that, your Bot is started, and Bot in-chat interaction too.

For using bot, user has a keyboard menu:

But, it can be used manually with three options:

/start - register user and remembers him

/help - shows to user all available commands

/qr - requesting bot for receiving a string to convert it to QR-code image

QR request returns to user a photo of QR-code in .png format with size 490x490

Main contributors: