diff options
author | 2022-01-12 15:40:48 -0500 | |
---|---|---|
committer | 2022-02-09 18:13:38 -0500 | |
commit | 4e5f98468d8fc450e01c99450f43f0c77b543747 (patch) | |
tree | d90c7ee701eac074b6def1048a8d976ba378617a | |
parent | reverting namedtuple change (diff) |
reverting back to original commit for a NamedTuple
-rw-r--r-- | bot/exts/events/trivianight/_game.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bot/exts/events/trivianight/_game.py b/bot/exts/events/trivianight/_game.py index 1526aa14..6d177783 100644 --- a/bot/exts/events/trivianight/_game.py +++ b/bot/exts/events/trivianight/_game.py @@ -1,7 +1,7 @@ import time from random import randrange from string import ascii_uppercase -from typing import Iterable, Optional, TypedDict +from typing import Iterable, NamedTuple, Optional, TypedDict DEFAULT_QUESTION_POINTS = 10 DEFAULT_QUESTION_TIME = 20 @@ -18,11 +18,12 @@ class QuestionData(TypedDict): time: Optional[int] -UserGuess = tuple[ - str, # Represents the answer choice the user chose. - bool, # Represents if the user can edit their answer. - float # Represents the amount of time passed since the question began. -] +class UserGuess(NamedTuple): + """Represents the user's guess for a question.""" + + answer: str + editable: bool + elapsed: float class QuestionClosed(RuntimeError): |