Git Product home page Git Product logo

quizbot's Introduction

QuizBot

Quiz bot for Telegram and Vkontakte

See for yourself:

How to install

Python should already be installed. This project is tested on Python 3.11. You may use other versions as you will, but YMMV.

Clone the repo / download code

Using virtual environment virtualenv/venv is recommended for project isolation.

Install requirements:

pip install -r requirements.txt

redis DB

This project uses redis database. Create and connect your instance at redis website

env variables

To configure those settings, create a .env file in the root folder of the project and put in there the following:

Typical Telegram settings

  • TELEGRAM_BOT_TOKEN - Access token of your bot. You get one from BotFather Telegram bot when you create a bot.
  • TELEGRAM_LOGGING_BOT_TOKEN - same as above, but used for sending logs. Can be the same bot or separate as the main one.
  • TELEGRAM_USER_ID - Your numeric Telegram ID. Can be checked by writing to special user info bot. Used to recieve logs.
  • LOGGING_LEVEL - Desired logging level
  • REDIS_HOST - Host of your redis database
  • REDIS_PORT - Port of your redis database
  • REDIS_PASSWORD - Password for your redis database
  • REDIS_DB_NUMBER - The ID of your redis database
  • QUIZ_FILE_PATH - Filepath to your quiz file in KOI8-R encoding (see quiz_questions/example.txt)

How to use

Telegram and VK bots are separate and should be launched by executing tg_bot.py and vk_bot.py

python tg_bot.py  # launches Telegram bot
python vk_bot.py  # launches VK bot

For Telegram bot to be able to send messages, send it a /start command

Telegram bot example:
Telegram example

Vkontakte bot example:
VK example

Project goals

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

quizbot's People

Contributors

mrdave avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.