diff options
| author | 2020-10-26 14:07:52 +0530 | |
|---|---|---|
| committer | 2020-10-26 14:07:52 +0530 | |
| commit | 4a1c7e74334b2db400ab77c9c53d30006bc3f726 (patch) | |
| tree | 41e0c5dd37b4a78a45137d52d169624149f20deb /bot/exts/evergreen/trivia_quiz.py | |
| parent | Typo in word "none" (diff) | |
| parent | Merge pull request #479 from Anubhav1603/bug_ec (diff) | |
Merge branch 'master' into candy
Diffstat (limited to 'bot/exts/evergreen/trivia_quiz.py')
| -rw-r--r-- | bot/exts/evergreen/trivia_quiz.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bot/exts/evergreen/trivia_quiz.py b/bot/exts/evergreen/trivia_quiz.py index 8dceceac..fe692c2a 100644 --- a/bot/exts/evergreen/trivia_quiz.py +++ b/bot/exts/evergreen/trivia_quiz.py @@ -121,8 +121,10 @@ class TriviaQuiz(commands.Cog): # A function to check whether user input is the correct answer(close to the right answer) def check(m: discord.Message) -> bool: - ratio = fuzz.ratio(answer.lower(), m.content.lower()) - return ratio > 85 and m.channel == ctx.channel + return ( + m.channel == ctx.channel + and fuzz.ratio(answer.lower(), m.content.lower()) > 85 + ) try: msg = await self.bot.wait_for('message', check=check, timeout=10) |