xgrg / slack-trivia

Quizzes (multiple-choice questions) in a Slack workspace

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

slack-trivia

pipeline status pipeline Status

slack-trivia is yet another integration for Slack workspaces to run quizzes (multiple choice questions) in a Slack channel. This runs as a Python script and is based on the Slack Python API.

Requirements

Getting started

  1. Clone or download the repository into a local folder.
  2. Add this folder to your $PYTHONPATH.
  3. Create an environment variable TOKEN with the bot token.
  4. Edit quizz.py and define su as a list of user IDs who will be allowed to operate the bot commands (hint: add the bot name)
  5. Run python quizz.py

Available commands

All users in same channel as the bot may play and answers questions. The following commands are for superusers only.

!quizz [channel] : post random question in given channel and wait for answers

!next [channel] : solve question and display scores

!create question [option_a, option_b, .., option_x] correct_letter : create a new question and adds it to the database

!scores : display current scores

!scores_reset : reset current scores

!json : export current questions in a JSON file

!table : display the workspace's user table

Cron

The cron script allows to send !quizz and !next commands to the bot at a given frequency so that questions are asked and solved automatically. Run it in parallel of quizz.py.

About

Quizzes (multiple-choice questions) in a Slack workspace

License:MIT License


Languages

Language:Python 100.0%