aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar kosayoda <[email protected]>2020-10-01 13:08:55 +0800
committerGravatar kosayoda <[email protected]>2020-10-01 13:08:55 +0800
commit063fb4cbed635e91404e3be833629d5ad1cdf136 (patch)
treef6d3feea550f1808e4dcee9a5edf926b5ba2638a
parentFuzzy 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.py5
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)