aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Shom770 <[email protected]>2022-01-10 22:09:23 -0500
committerGravatar Shom770 <[email protected]>2022-02-09 18:13:38 -0500
commitde66d41a7ab350b684ed7b5f829136ebdb4d9c37 (patch)
treea867ac44c939d57e6b8db2e7788c344e497ea936
parentdefault timer is at 20 seconds (diff)
Apply suggestions from code review
Co-authored-by: Johannes Christ <[email protected]>
-rw-r--r--bot/exts/events/trivianight/_game.py9
-rw-r--r--bot/exts/events/trivianight/_scoreboard.py4
2 files changed, 6 insertions, 7 deletions
diff --git a/bot/exts/events/trivianight/_game.py b/bot/exts/events/trivianight/_game.py
index 994006bf..a47025c2 100644
--- a/bot/exts/events/trivianight/_game.py
+++ b/bot/exts/events/trivianight/_game.py
@@ -18,11 +18,10 @@ class QuestionData(TypedDict):
time: Optional[int]
-UserGuess = tuple[
- str, # The answer that was guessed
- bool, # Whether the answer can be changed again
- float # The time it took to guess
-]
+class UserGuess(NamedTuple):
+ answer: str
+ editable: bool
+ elapsed: float
class QuestionClosed(RuntimeError):
diff --git a/bot/exts/events/trivianight/_scoreboard.py b/bot/exts/events/trivianight/_scoreboard.py
index 769d6a88..583532a3 100644
--- a/bot/exts/events/trivianight/_scoreboard.py
+++ b/bot/exts/events/trivianight/_scoreboard.py
@@ -80,8 +80,8 @@ class ScoreboardView(View):
rank_embed = Embed(title=f"Ranks for {member.display_name}", color=Colours.python_blue)
# These are stored as strings so that the last digit can be determined to choose the suffix
try:
- points_rank = str(list(self.points.keys()).index(member.id) + 1)
- speed_rank = str(list(self.speed.keys()).index(member.id) + 1)
+ points_rank = str(list(self.points).index(member.id) + 1)
+ speed_rank = str(list(self.speed).index(member.id) + 1)
except ValueError:
return Embed(
title=choice(NEGATIVE_REPLIES),