[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:
Michael H
2018-10-05 18:39:52 -04:00
committed by Toby Harradine
parent d79996aeea
commit 139329233a
3 changed files with 40 additions and 1 deletions

View File

@@ -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