aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen/trivia_quiz.py
diff options
context:
space:
mode:
authorGravatar William Da Silva <[email protected]>2020-12-29 01:15:03 -0500
committerGravatar GitHub <[email protected]>2020-12-29 01:15:03 -0500
commit52d626131527dfae3c100aab9a530bae928b0fff (patch)
tree8b09d5e4579924d8f1c7b9917cb2f04fdd54c29c /bot/exts/evergreen/trivia_quiz.py
parentCapitalize "ID" in error message (diff)
parentMerge pull request #484 from WillDaSilva/omdb-to-tmdb (diff)
Merge branch 'master' into startup-channel-check
Diffstat (limited to 'bot/exts/evergreen/trivia_quiz.py')
-rw-r--r--bot/exts/evergreen/trivia_quiz.py6
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)