From 971bb3fe17d34a30cc9492e46d3992735c3cf276 Mon Sep 17 00:00:00 2001 From: Anubhav1603 Date: Sun, 11 Oct 2020 19:01:25 +0530 Subject: changed return --- bot/exts/evergreen/trivia_quiz.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bot/exts/evergreen/trivia_quiz.py') diff --git a/bot/exts/evergreen/trivia_quiz.py b/bot/exts/evergreen/trivia_quiz.py index 8dceceac..4dbb1c6a 100644 --- a/bot/exts/evergreen/trivia_quiz.py +++ b/bot/exts/evergreen/trivia_quiz.py @@ -121,8 +121,9 @@ 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) -- cgit v1.2.3 From 32fdc750cf35290256fd9a439f168eabb2743e72 Mon Sep 17 00:00:00 2001 From: Anubhav1603 Date: Tue, 13 Oct 2020 13:37:16 +0530 Subject: improved readbility of code by adding line break --- bot/exts/evergreen/trivia_quiz.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bot/exts/evergreen/trivia_quiz.py') diff --git a/bot/exts/evergreen/trivia_quiz.py b/bot/exts/evergreen/trivia_quiz.py index 4dbb1c6a..fe692c2a 100644 --- a/bot/exts/evergreen/trivia_quiz.py +++ b/bot/exts/evergreen/trivia_quiz.py @@ -122,7 +122,8 @@ 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: return ( - m.channel == ctx.channel and fuzz.ratio(answer.lower(), m.content.lower()) > 85 + m.channel == ctx.channel + and fuzz.ratio(answer.lower(), m.content.lower()) > 85 ) try: -- cgit v1.2.3