An IRC-based trivia bot powered by Mistral AI for dynamic question generation. QuizBot creates engaging quiz games with automatically generated questions across various categories, featuring scoring systems, player statistics, and multiplayer support.
Join us on MansionNET IRC to chat with us, test the bot, and play some trivia!
🌐 Server: irc.inthemansion.com
🔒 Port: 6697 (SSL)
📝 Channel: #opers, #general, #welcome, #devs (and many others)
- Dynamic Question Generation: Uses Mistral AI to create unique, contextually relevant questions
- Multiple Categories: Covers science, history, geography, arts, sports, technology, nature, space, literature, and music
- Scoring System: Features streak multipliers and speed-based scoring
- Player Statistics: Tracks scores, correct answers, best streaks, and fastest answers
- Admin Controls: Moderation tools for game management
- Persistent Storage: SQLite database for questions and player stats
- Rate Limiting: Smart token bucket implementation for API calls
!quiz
- Start a new quiz game!stats
- Show your statistics!leaderboard
- Show top players!help
- Display help message!stop
- Stop the current game (admin only)
- Python 3.9+
- Mistral AI API key
- IRC server access
- Clone the repository:
git clone https://github.com/mansionNET/QuizBot.git
cd QuizBot
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Create a
.env
file with your configuration:
IRC_SERVER=irc.example.com
IRC_PORT=6697
IRC_NICKNAME=QuizBot
IRC_CHANNELS=#channel1,#channel2
ADMIN_USERS=admin1,admin2
MISTRAL_API_KEY=your_api_key_here
DATABASE_URL=sqlite:///quiz.db
- Ensure your
.env
file is configured correctly - Run the bot:
python src/main.py
quizbot/
├── src/
│ ├── models/
│ │ ├── database.py
│ │ ├── question.py
│ │ └── quiz_state.py
│ ├── services/
│ │ ├── irc_service.py
│ │ └── mistral_service.py
│ ├── utils/
│ │ ├── scoring.py
│ │ └── text_processing.py
│ ├── bot.py
│ ├── config.py
│ ├── game_manager.py
│ └── main.py
├── .env.example
├── .gitignore
├── LICENSE
├── README.md
└── requirements.txt
QUESTION_TIMEOUT
: Time allowed for answering each question (default: 30 seconds)MIN_ANSWER_TIME
: Minimum time between answers to prevent spam (default: 1.0 seconds)BASE_POINTS
: Base points for correct answers (default: 100)QUESTIONS_PER_GAME
: Number of questions per game (default: 10)SPEED_MULTIPLIER_MAX
: Maximum speed bonus multiplier (default: 2.0)
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Mistral AI for question generation
- Uses Python IRC for IRC connectivity
- SQLAlchemy for database management