aboutsummaryrefslogtreecommitdiffstats
path: root/bot
diff options
context:
space:
mode:
authorGravatar Shom770 <[email protected]>2021-11-28 22:46:29 -0500
committerGravatar Shom770 <[email protected]>2022-02-09 18:13:37 -0500
commit52f1b8cbcc41950f9845d4ef1026253691b921c7 (patch)
treeb982e75378b91a78c3dd4e385eacd0eb4a83eaf8 /bot
parentmaking the docstrings nicer (diff)
add logic to make sure that the event can't be ended during a question
Diffstat (limited to 'bot')
-rw-r--r--bot/exts/events/trivianight/trivianight.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/bot/exts/events/trivianight/trivianight.py b/bot/exts/events/trivianight/trivianight.py
index a86bd73f..1fffe9fe 100644
--- a/bot/exts/events/trivianight/trivianight.py
+++ b/bot/exts/events/trivianight/trivianight.py
@@ -254,6 +254,15 @@ class TriviaNight(commands.Cog):
The scoreboard view also has a button where the user can see their own rank, points and average speed if they
didn't make it onto the leaderboard.
"""
+ if self.questions.view.active_question is True:
+ error_embed = Embed(
+ title=choice(NEGATIVE_REPLIES),
+ description="You can't end the event while a question is ongoing!",
+ color=Colours.soft_red
+ )
+ await ctx.send(embed=error_embed)
+ return
+
scoreboard_embed, scoreboard_view = await self.scoreboard.display()
await ctx.send(embed=scoreboard_embed, view=scoreboard_view)