Application created for playing in a quiz. It has tons of questions to check your knowledge. in the social network Vkontacte and Telegram Messenger.
For local installation use requirements:
$pip install requirements.txt
Follow by this instruction instructions: how-do-i-create-a-bot. Repeat it twice one Bot will serve for customers and the second one will send errors to you. You should have two telegram tokens Get chat_id which equal to user Id from the special Bot _@userinfobot.
Create VK account, public group and get VK_API token.
Follow instructions on page https://vk.com/club<your_vk_id>?act=tokens
Store somewhere API key, Group id
By default both modules use RedisLabs server for caching questions and answer.
But you can set on your own server via --memcached_server
and --memcached_charset
arguments.
You will needed to save user activity in a key-value DB Redis.
Sign up Redis Labs and get the port number and the password for your database
Create .env
file with list of settings:
- TLG_TOKEN
- VK_API
- REDIS_PASSWORD
- VK_GROUP
- SVC_TLG_TOKEN
- TLG_CHAT_ID
- REDIS_PORT
- HTTPS_PROXY (it is needed only to circumvent some country's restrictions)
Run this python TG_bot.py
then go to chat with your Bot.
Start the quiz by launching \start
command. Bot should show you Menu buttons.
Do the same with VK_bot.py
. Chat with bot in a chat you've created before.
- Sign up by this link.
- Fork this repo if you will
- create an app. You will need two one for Telegram and second for VK
- Link your repo with your applications
- It necessitates creating few settings, that described in the Local installation section, on the Settings Tab of the app.
- Deploy applications
The procfile has one line for each app:
- bot-tlg: python3 TG_bot.py
- bot-vk: python3 VK_bot.py
Switch on one bot for each app on the Resources Tab
The code has been written for educational purposes on online-course for web-developers dvmn.org
This project is licensed under the MIT License - see the LICENSE.md file for details