mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-06 01:12:33 -05:00
Fix poor fuzzy results due to changes in rapidfuzz 3.0 (#6224)
Co-authored-by: aikaterna <20862007+aikaterna@users.noreply.github.com>
This commit is contained in:
@@ -6,7 +6,7 @@ from typing import Iterable, List, Mapping, Tuple, Dict, Set, Literal, Union
|
||||
from urllib.parse import quote_plus
|
||||
|
||||
import discord
|
||||
from rapidfuzz import process
|
||||
import rapidfuzz
|
||||
|
||||
from redbot.core import Config, commands
|
||||
from redbot.core.commands import Parameter
|
||||
@@ -324,7 +324,9 @@ class CustomCommands(commands.Cog):
|
||||
- `<query>` The query to search for. Can be multiple words.
|
||||
"""
|
||||
cc_commands = await CommandObj.get_commands(self.config.guild(ctx.guild))
|
||||
extracted = process.extract(query, list(cc_commands.keys()))
|
||||
extracted = rapidfuzz.process.extract(
|
||||
query, list(cc_commands.keys()), processor=rapidfuzz.utils.default_process
|
||||
)
|
||||
accepted = []
|
||||
for key, score, __ in extracted:
|
||||
if score > 60:
|
||||
|
||||
Reference in New Issue
Block a user