diff options
author | 2020-10-01 13:08:55 +0800 | |
---|---|---|
committer | 2020-10-01 13:08:55 +0800 | |
commit | 063fb4cbed635e91404e3be833629d5ad1cdf136 (patch) | |
tree | f6d3feea550f1808e4dcee9a5edf926b5ba2638a | |
parent | Fuzzy match roles for `!role` command. (diff) |
Use basic scorer to fuzz a bit stricter.
This prevents weird fuzz matches like `!role a b c d` working.
-rw-r--r-- | bot/exts/info/information.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bot/exts/info/information.py b/bot/exts/info/information.py index 0386a2909..bfc05cea9 100644 --- a/bot/exts/info/information.py +++ b/bot/exts/info/information.py @@ -116,7 +116,10 @@ class Information(Cog): parsed_roles.append(role_name) continue - match = fuzzywuzzy.process.extractOne(role_name, all_roles, score_cutoff=80) + match = fuzzywuzzy.process.extractOne( + role_name, all_roles, score_cutoff=80, + scorer=fuzzywuzzy.fuzz.ratio + ) if not match: failed_roles.append(role_name) |