aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/events/trivianight/trivianight.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot/exts/events/trivianight/trivianight.py')
-rw-r--r--bot/exts/events/trivianight/trivianight.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/bot/exts/events/trivianight/trivianight.py b/bot/exts/events/trivianight/trivianight.py
index 609f6651..2ec869ab 100644
--- a/bot/exts/events/trivianight/trivianight.py
+++ b/bot/exts/events/trivianight/trivianight.py
@@ -41,6 +41,20 @@ class TriviaNight(commands.Cog):
await ctx.send(embed=success_embed)
@trivianight.command()
+ async def reset(self, ctx: commands.Context) -> None:
+ """Resets previous questions and scoreboards."""
+ self.scoreboard.view = ScoreboardView(self.bot)
+ for question in self.questions.questions:
+ del question["visited"]
+
+ success_embed = Embed(
+ title=choice(POSITIVE_REPLIES),
+ description="The scoreboards were reset and questions marked unvisited!",
+ color=Colours.soft_green
+ )
+ await ctx.send(embed=success_embed)
+
+ @trivianight.command()
async def next(self, ctx: commands.Context) -> None:
"""Gets a random question from the unanswered question list and lets user choose the answer."""
next_question = self.questions.next_question()
@@ -52,6 +66,23 @@ class TriviaNight(commands.Cog):
await ctx.send(embed=question_embed, view=question_view)
@trivianight.command()
+ async def question(self, ctx: commands.Context, question_number: int) -> None:
+ """Gets a question from the question bank depending on the question number provided."""
+ question = self.questions.next_question(question_number)
+ if isinstance(question, Embed):
+ await ctx.send(embed=question)
+ return
+
+ question_embed, question_view = self.questions.current_question()
+ await ctx.send(embed=question_embed, view=question_view)
+
+ @trivianight.command()
+ async def list(self, ctx: commands.Context) -> None:
+ """Displays all the questions from the question bank."""
+ formatted_string = self.questions.list_questions()
+ await ctx.send(formatted_string)
+
+ @trivianight.command()
async def stop(self, ctx: commands.Context) -> None:
"""End the ongoing question to show the correct question."""
await ctx.send(embed=self.questions.end_question())