aboutsummaryrefslogtreecommitdiffstats
path: root/bot
diff options
context:
space:
mode:
authorGravatar Shom770 <[email protected]>2021-11-29 19:40:28 -0500
committerGravatar Shom770 <[email protected]>2022-02-09 18:13:37 -0500
commitf821d802357193f82723233f5dd1d55d51ec8ea6 (patch)
tree6ce9756114464b0912f71a80e185bd936e9f829a /bot
parentforgot eturn after error message (diff)
prevent bugs with question regarding multiple choices
Diffstat (limited to 'bot')
-rw-r--r--bot/exts/events/trivianight/_questions.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/bot/exts/events/trivianight/_questions.py b/bot/exts/events/trivianight/_questions.py
index eaabed4f..0ab657d2 100644
--- a/bot/exts/events/trivianight/_questions.py
+++ b/bot/exts/events/trivianight/_questions.py
@@ -103,9 +103,10 @@ class QuestionView(View):
description=self.current_question["obfuscated_description"],
color=Colours.python_yellow
)
- self.buttons = [QuestionButton(label, self.users_picked, self) for label in self.current_labels]
- for button in self.buttons:
- self.add_item(button)
+ if "_previously_visited" not in self.current_question.keys():
+ self.buttons = [QuestionButton(label, self.users_picked, self) for label in self.current_labels]
+ for button in self.buttons:
+ self.add_item(button)
for label, answer in zip(self.current_labels, self.current_question["answers"]):
question_embed.add_field(name=f"Answer {label}", value=answer, inline=False)
@@ -216,6 +217,8 @@ class Questions:
else:
question_number = number - 1
+ if "visited" in self.questions[question_number].keys():
+ self.questions[question_number]["_previously_visited"] = True
self.questions[question_number]["visited"] = True
# The `self.view` refers to the QuestionView