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:
Jakub Kuczys
2022-12-30 03:21:57 +01:00
committed by GitHub
parent d3308af0e2
commit 519acedf46
59 changed files with 324 additions and 373 deletions

View File

@@ -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