mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-07 01:42:30 -05:00
[Core] Help Redesign (#2628)
* [Bot] Support new design * [Context] use the new help in `ctx.send_help` * [Commands] Update Cog and Group for help compat - Removes a trap with all_commands, this isn't a good way to check this - Adds a help property - Fixes command parsing in invoke * Redesigns red's help * handle fuzzy help * style * handle a specific ugly hidden interaction * fix bot-wide help grouping * changelog * remove no longer needed -
This commit is contained in:
@@ -176,7 +176,11 @@ async def async_enumerate(
|
||||
|
||||
|
||||
async def fuzzy_command_search(
|
||||
ctx: commands.Context, term: Optional[str] = None, *, min_score: int = 80
|
||||
ctx: commands.Context,
|
||||
term: Optional[str] = None,
|
||||
*,
|
||||
commands: Optional[list] = None,
|
||||
min_score: int = 80,
|
||||
) -> Optional[List[commands.Command]]:
|
||||
"""Search for commands which are similar in name to the one invoked.
|
||||
|
||||
@@ -230,7 +234,9 @@ async def fuzzy_command_search(
|
||||
return
|
||||
|
||||
# Do the scoring. `extracted` is a list of tuples in the form `(command, score)`
|
||||
extracted = process.extract(term, ctx.bot.walk_commands(), limit=5, scorer=fuzz.QRatio)
|
||||
extracted = process.extract(
|
||||
term, (commands or ctx.bot.walk_commands()), limit=5, scorer=fuzz.QRatio
|
||||
)
|
||||
if not extracted:
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user