aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar kosayoda <[email protected]>2020-07-15 11:39:17 +0800
committerGravatar kosayoda <[email protected]>2020-07-15 11:39:17 +0800
commiteec57c86999bb2e9486dd6443b44cfd29026c823 (patch)
tree82ee701aaff0e57f75e3c51d43637023641fb011
parentInvoke fuzzywuzzy's processor before matching (diff)
Pass processed string to `extractBests`
Fixes a regression where the string to be matched was not processed beforehand.
-rw-r--r--bot/cogs/help.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/cogs/help.py b/bot/cogs/help.py
index 198e88b55..5f3fc4750 100644
--- a/bot/cogs/help.py
+++ b/bot/cogs/help.py
@@ -150,8 +150,8 @@ class CustomHelpCommand(HelpCommand):
# Run fuzzywuzzy's processor beforehand, and avoid matching if processed string is empty
# This avoids fuzzywuzzy from raising a warning on inputs with only non-alphanumeric characters
- if full_process(string):
- result = process.extractBests(string, choices, scorer=fuzz.ratio, score_cutoff=60, processor=None)
+ if (processed := full_process(string)):
+ result = process.extractBests(processed, choices, scorer=fuzz.ratio, score_cutoff=60, processor=None)
else:
result = []