diff options
author | 2022-01-11 20:00:13 -0500 | |
---|---|---|
committer | 2022-02-09 18:13:38 -0500 | |
commit | 74dcb9910da45c4e135ece34f6491c625bba6a79 (patch) | |
tree | e50e9252bfe79040adc6c5f569e4ca69f9bf18e6 /bot | |
parent | int to ordinal as a separate method (diff) |
reverting namedtuple change
Diffstat (limited to 'bot')
-rw-r--r-- | bot/exts/events/trivianight/_game.py | 9 | ||||
-rw-r--r-- | bot/exts/events/trivianight/_scoreboard.py | 7 |
2 files changed, 11 insertions, 5 deletions
diff --git a/bot/exts/events/trivianight/_game.py b/bot/exts/events/trivianight/_game.py index a47025c2..1526aa14 100644 --- a/bot/exts/events/trivianight/_game.py +++ b/bot/exts/events/trivianight/_game.py @@ -18,10 +18,11 @@ class QuestionData(TypedDict): time: Optional[int] -class UserGuess(NamedTuple): - answer: str - editable: bool - elapsed: float +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 QuestionClosed(RuntimeError): diff --git a/bot/exts/events/trivianight/_scoreboard.py b/bot/exts/events/trivianight/_scoreboard.py index 56a86029..7ec3c76b 100644 --- a/bot/exts/events/trivianight/_scoreboard.py +++ b/bot/exts/events/trivianight/_scoreboard.py @@ -17,7 +17,12 @@ class ScoreboardView(View): @staticmethod def _int_to_ordinal(number: int) -> str: - """Converts an integer into an ordinal number, i.e. 1 to 1st.""" + """ + Converts an integer into an ordinal number, i.e. 1 to 1st. + + Parameters: + - number: an integer representing the number to convert to an ordinal number. + """ suffix = ["th", "st", "nd", "rd", "th"][min(number % 10, 4)] if (number % 100) in {11, 12, 13}: suffix = "th" |