Skip to content

Update trivia_quiz.py - #1767

Open
Kaztral-ar wants to merge 1 commit into
python-discord:mainfrom
Kaztral-ar:main
Open

Update trivia_quiz.py#1767
Kaztral-ar wants to merge 1 commit into
python-discord:mainfrom
Kaztral-ar:main

Conversation

@Kaztral-ar

Copy link
Copy Markdown

Fixed #1766.

The issue was caused by a small gap between "wait_for()" calls. While the bot was sending hint or score messages, it wasn't actively checking for new answers, so a correct answer could be missed.

I changed this to use a persistent "on_message" listener that buffers messages in a per-channel queue. Answers are now processed strictly in arrival order, so the first correct answer always gets credited, even when multiple users answer at the same time.

This change introduces a message buffering system for active trivia quizzes, ensuring that all player responses are captured in the correct order. It prevents missed answers during transitions between questions and hints.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Potential performance/concurrency issue with [p]quiz under message pressure

1 participant