mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 10:17:59 -05:00
[Utils/Trivia] Handle smart quotes (#2162)
Adds a new filter function for substituting out smart-quotes. Makes trivia use it.
This commit is contained in:
committed by
Toby Harradine
parent
d79996aeea
commit
139329233a
@@ -6,6 +6,7 @@ from collections import Counter
|
||||
import discord
|
||||
from redbot.core.bank import deposit_credits
|
||||
from redbot.core.utils.chat_formatting import box
|
||||
from redbot.core.utils.common_filters import normalize_smartquotes
|
||||
from .log import LOG
|
||||
|
||||
__all__ = ["TriviaSession"]
|
||||
@@ -222,6 +223,7 @@ class TriviaSession:
|
||||
|
||||
self._last_response = time.time()
|
||||
guess = message.content.lower()
|
||||
guess = normalize_smartquotes(guess)
|
||||
for answer in answers:
|
||||
if " " in answer and answer in guess:
|
||||
# Exact matching, issue #331
|
||||
|
||||
Reference in New Issue
Block a user