mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-05 17:02:32 -05:00
Make some dependency changes, support Python 3.10 and 3.11 (#5611)
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
@@ -7,7 +7,7 @@ from typing import Iterable, List, Mapping, Tuple, Dict, Set, Literal, Union
|
||||
from urllib.parse import quote_plus
|
||||
|
||||
import discord
|
||||
from fuzzywuzzy import process
|
||||
from rapidfuzz import process
|
||||
|
||||
from redbot.core import Config, checks, commands
|
||||
from redbot.core.i18n import Translator, cog_i18n
|
||||
@@ -317,7 +317,7 @@ class CustomCommands(commands.Cog):
|
||||
"""
|
||||
Searches through custom commands, according to the query.
|
||||
|
||||
Uses fuzzywuzzy searching to find close matches.
|
||||
Uses fuzzy searching to find close matches.
|
||||
|
||||
**Arguments:**
|
||||
|
||||
@@ -326,10 +326,10 @@ class CustomCommands(commands.Cog):
|
||||
cc_commands = await CommandObj.get_commands(self.config.guild(ctx.guild))
|
||||
extracted = process.extract(query, list(cc_commands.keys()))
|
||||
accepted = []
|
||||
for entry in extracted:
|
||||
if entry[1] > 60:
|
||||
for key, score, __ in extracted:
|
||||
if score > 60:
|
||||
# Match was decently strong
|
||||
accepted.append((entry[0], cc_commands[entry[0]]))
|
||||
accepted.append((key, cc_commands[key]))
|
||||
else:
|
||||
# Match wasn't strong enough
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user