Skip to content

SergeyKozyr/vk-tg-quiz-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Simple quiz bots for Vkontakte and Telegram. Bot sends a random question from the questions directory, if the user answers correctly, bot congratulates the user and awaits for the next question, if the user is wrong, bot asks the user to try again. After the question is received, the user can press the give up button to get the right answer and the next question.

Each bot's logs are sent to Logging bot via telegram.

Demo

Start the dialog with Telegram bot or VK bot.

Telegram bot

How to install

  1. Running on a local machine

Create .env file with the variables:

VK_COMMUNITY_TOKEN
TG_QUIZBOT_TOKEN
TG_LOGGING_BOT_TOKEN
TG_CHAT_ID
REDIS_HOST
REDIS_PASSWORD
REDIS_PORT 

Create vk group, in your group click manage -> Api usage and generate an access token with community management and messages access settings.

Telegram bot tokens are available after creation in @BotFather chat. For your chat id send, a message to @userinfobot.

Create Redis database

Install dependencies.

pip install -r requirements.txt

Extract all files from quiz-questions.zip into the questions directory.

Run the script, send a message to the bot.

python vk-bot.py

python tg-bot.py


  1. Deploying with Heroku

Clone the repository, sign up or log in at Heroku.

Create a new Heroku app, click on Deploy tab and connect your Github account.

Type in the repository name and click Deploy Branch at the bottom of the page.

Set up environment variables at the Settings tab in Config Vars

Turn on the bot process on Resources tab.


Project Goals

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

About

Telegram and VK quiz bots

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages