Test bot work by Telegram messenger and VKontakte social network.
- Clone repository from github.
- Create virtual environment.
- Install using pip with:
pip install -r requirements.txt
. - Create
.env
file and fill with:
DB_PASSWORD='Redis database password'
DB_URL='Redis database url'
DB_PORT='Redis database port'
TG_BOT_TOKEN='Bot token from Telegram'
VK_BOT_KEY='api group key'
DIR='Question files local repository'
- Two scripts must be specified In Procfile:
bot-tg: python3 tg_bot.py
bot-vk: python3 vk_bot.py
- Deploy git repository in Heroku server.
- Carry over all variables from
.env
toReveal Config Vars
in heroku/settings.
Running from command line:
python tg_bot.py
to start telegram bot.
python vk_bot.py
to start vkontakte bot.
If question files repository changed, use :
python quiz_questions.py -l 'you repository'
Script save your repository, and use it in next time.
You may copy, distribute and modify the software.
The code is written for educational purposes - this is a lesson in the Python and web development course at [Devman] (https://dvmn.org).