Bots for the quiz

Maintainability Build Status Documentation Status GitHub wemake-python-styleguide

This repository contains Vkontakte and Telegram chatbots for the quiz.

Features

  • Questions are taken from text files located in the specified folder;

  • The database is stored in cloud Redis;

  • The user has an unlimited number of attempts to answer the question;

  • The user can surrender. After he gets the correct answer and the next question.

How to install

  • Copy the scripts to your computer:

    git clone https://github.com/eskelevir/quiz-bot.git
    
  • Go to the folder:

    cd quiz-bot
    
  • Install the required python packages:

Python3 should be already installed. Then use pip (or pip3, if there is a conflict with Python2) to install dependencies:

pip install -r requirements.txt

Remember, it is recommended to use virtualenv/venv for better isolation.

  • Create a folder for quiz content and extract the archive into it ;

  • Get the necessary data to work with Vkontakte and Telegram (link);

  • Create and configure Telegram bot to receive notifications (link);

  • Get the necessary data to work with Redis (link);

  • Create the file. env and record the received data:

    QUIZ_FOLDER_PATH=the path to the folder with text files with material for the quiz
    TG_TOKEN=Telegram bot token
    VK_TOKEN=Vkontakte bot token
    TG_LOGGER_BOT_TOKEN=Telegram logger bot token
    TG_LOGGER_BOT_CHAT_ID=Telegram logger chat id
    REDIS_ENDPOINT=url db
    REDIS_DB_PASSWORD=Redis database password
    

How to run

Telegram bot:

python3 quiz_bot/tg_bot.py

VK bot:

python3 quiz_bot/vk_bot.py

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project Goals

The code is written for educational purposes on online-course for web-developers dvmn.org.

Indices and tables