From e7931b20a16ea060027d681c21797b2648a6ccfb Mon Sep 17 00:00:00 2001 From: victormylle Date: Sat, 14 Nov 2020 13:32:31 +0100 Subject: [PATCH] Changed quiz interval --- cogs/quiz.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/cogs/quiz.py b/cogs/quiz.py index 3a11e53..cdff2d3 100644 --- a/cogs/quiz.py +++ b/cogs/quiz.py @@ -78,19 +78,28 @@ class QuizQuestions(commands.Cog): class Quiz(commands.Cog): def __init__(self, client): self.client = client - self.interval = (5, 10) - self.interval = (8*60, 30*60) + #self.interval = (5, 10) + self.interval = (5*60, 20*60) self.auto = False self.timeout = 60*10 - @commands.command(name="quiz") + + @commands.group(name="questions",case_insensitive=True, invoke_without_command=True) @commands.check(checks.isModPlus) async def quiz_bot(self, ctx, f, *args): - if (f == "auto" and not self.auto): - self.auto = True - asyncio.create_task(self.start_auto_quiz()) - elif (f == "stop" and self.auto): - self.auto = False + pass + + @quiz.command(name="auto") + @commands.check(checks.isModPlus) + async def auto_quiz(self, ctx): + self.auto = True + asyncio.create_task(self.start_auto_quiz()) + + @quiz.command(name="stop") + @commands.check(checks.isModPlus) + async def auto_quiz(self, ctx): + self.auto = False + async def start_auto_quiz(self): while self.auto: