aboutsummaryrefslogtreecommitdiffstats
path: root/bot
diff options
context:
space:
mode:
authorGravatar Shom770 <[email protected]>2022-01-11 20:00:13 -0500
committerGravatar Shom770 <[email protected]>2022-02-09 18:13:38 -0500
commit74dcb9910da45c4e135ece34f6491c625bba6a79 (patch)
treee50e9252bfe79040adc6c5f569e4ca69f9bf18e6 /bot
parentint to ordinal as a separate method (diff)
reverting namedtuple change
Diffstat (limited to 'bot')
-rw-r--r--bot/exts/events/trivianight/_game.py9
-rw-r--r--bot/exts/events/trivianight/_scoreboard.py7
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"