diff options
| author | 2020-07-15 11:39:17 +0800 | |
|---|---|---|
| committer | 2020-07-15 11:39:17 +0800 | |
| commit | eec57c86999bb2e9486dd6443b44cfd29026c823 (patch) | |
| tree | 82ee701aaff0e57f75e3c51d43637023641fb011 | |
| parent | Invoke 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.py | 4 |
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 = [] |