https://github.com/stefanopaolonii/quizbot
Telegram Quiz Bot โ A Telegram bot written in Python that manages interactive quizzes with customizable questions. Supports multiple languages and topics. Easy to set up and modify.
https://github.com/stefanopaolonii/quizbot
automation bot-development chatbot json open-source python python-telegram-bot quiz-bot telegram-bot telegram-quiz-bot telegram-quiz-game
Last synced: 9 months ago
JSON representation
Telegram Quiz Bot โ A Telegram bot written in Python that manages interactive quizzes with customizable questions. Supports multiple languages and topics. Easy to set up and modify.
- Host: GitHub
- URL: https://github.com/stefanopaolonii/quizbot
- Owner: stefanopaolonii
- License: gpl-3.0
- Created: 2025-02-05T13:07:44.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-03-31T13:33:45.000Z (9 months ago)
- Last Synced: 2025-03-31T14:44:27.984Z (9 months ago)
- Topics: automation, bot-development, chatbot, json, open-source, python, python-telegram-bot, quiz-bot, telegram-bot, telegram-quiz-bot, telegram-quiz-game
- Language: Python
- Homepage:
- Size: 72.3 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README


# Quiz-Bot: A Telegram Bot for Interactive Quizzes ๐ค๐ฎ
`quiz-bot` is a **Telegram bot** designed to create, manage, and take interactive quizzes. It allows users to start a quiz, add and modify questions, and review existing questions. The bot supports **multiple languages** and allows questions to be categorized by topics. ๐๐
While all users can participate in quizzes, only authorized users (staff) can add, edit, and manage quiz questions, providing a flexible and secure environment for quiz management. ๐
## Features of Quiz-Bot โจ
- **Start Quiz**: Users can initiate a quiz and answer a series of questions. ๐ฏ
- **Add Question**: Authorized users (staff members) can add new questions to the quiz database. ๐
- **Review Question**: Users can review and explore existing quiz questions. ๐
- **Modify Question**: Only staff members can modify or update existing questions. ๐ ๏ธ
- **Staff Management**: An advanced system for managing staff with different roles, such as Owner, Admin, and Moderator. ๐จโ๐ป๐ฉโ๐ป
- **Report System**: Users can submit, review, and manage quiz-related reports. ๐
- **Privacy Enhancements**: User IDs are masked for added privacy and anonymity. ๐ต๏ธโโ๏ธ
- **Automated Testing**: Ensures that updates do not break functionality by testing the bot automatically. ๐งช
- **Module Update Automation**: Automatically manages and updates the botโs dependencies. ๐
## Requirements ๐
- **Python Version**: 3.7 or higher ๐
- **Required Libraries**:
- `python-telegram-bot` (for Telegram API integration) ๐ฒ
- `asyncio` (for asynchronous functionality) โณ
- **Optional**: Docker for containerized deployment ๐ข
## Installation Guide ๐ ๏ธ
### Install Quiz-Bot Using Python
1. **Fork and Clone the Repository**:
```bash
git clone https://github.com/your-username/quiz-bot.git
cd quiz-bot
```
2. **Create a Virtual Environment**:
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
3. **Install Required Dependencies**:
```bash
pip install -r requirements.txt
```
### Install Quiz-Bot Using Docker
1. **Fork and Clone the Repository**:
```bash
git clone https://github.com/your-username/quiz-bot.git
cd quiz-bot
```
2. **Build the Docker Image**:
```bash
docker build -t quiz-bot .
```
3. **Run the Docker Container**:
```bash
docker run -d --name quiz-bot -v $(pwd)/config.py:/app/config.py -v $(pwd)/questions.json:/app/questions.json quiz-bot
```
## Configuration of Quiz-Bot โ๏ธ
1. **Create a `config.py` File**:
Create a `config.py` file in the main project directory with the following content:
```python
TOKEN = "YOUR_BOT_TOKEN"
QUESTIONS_JSON_PATH = "data/questions.json"
STAFF_JSON_PATH = "data/staff.json"
REPORT_JSON_PATH = "data/reports.json"
```
2. **Setup Questions File (`questions.json`)**:
Ensure you have a `data/questions.json` file containing an array of questions in the following format:
```json
[
{
"id": -1,
"language": "en",
"text": "What is the capital of France?",
"options": [
"Berlin",
"Madrid",
"Paris",
"Rome"
],
"correct_index": 2,
"verified": true,
"explanation": "Paris is the capital city of France.",
"topic": "Geography"
}
]
```
3. **Setup Staff File (`staff.json`)**:
Define the staff members and their roles in the `staff.json` file:
```json
[
{
"id": "YOUR_USER_ID",
"role": "Owner" # Possible roles: Owner, Admin, Mod
}
]
```
## Running the Quiz-Bot ๐
Once you've completed the installation and configuration steps, you can start the bot with the following command:
```bash
python main.py