Discord Trivia Bot

Phase 1 — Core Bot & Basic Quiz Logic

  • Implement a Discord bot connected via the Discord API.
  • Users can start a personal quiz session with a command.
  • Bot asks a single question from a predefined set (stored in memory or JSON).
  • Users submit answers via a command.
  • Check correctness and reply immediately.

Functional result: each user can start a quiz session, answer a question, and get immediate feedback on correctness.


Phase 2 — Database Integration

  • Set up a SQLite (or other) database to store:

    • Users
    • Scores
    • Questions answered
  • Track per-user statistics:

    • Number of correct/incorrect answers
    • Total quizzes taken
  • Ensure multiple users’ sessions don’t interfere.

Functional result: user progress and scores persist across bot restarts; multiple users can answer simultaneously without conflicts.


Phase 3 — Quiz Management & Command Enhancements

  • Add more commands for the following functionalities:

    • get next question in the user’s session
    • show personal stats
    • leaderboard: display top users globally
  • Implement question selection:

    • Random question from pool
    • Avoid repeating questions already answered by the user

Functional result: users can progress through a personalized quiz, see scores, and view leaderboards.


Phase 4 — Robustness & Extra Features

  • Handle invalid commands gracefully.
  • Add question categories and allow users to pick a category.
  • Implement per-user session timeout if inactive.
  • Log errors and quiz sessions for debugging.

Functional result: bot runs reliably with multiple concurrent users, tracks stats per user, handles errors, and supports multiple categories.