[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:
Michael H
2019-05-14 23:49:51 -04:00
committed by Will
parent a5f38fa6e6
commit 7f1c2b475b
6 changed files with 592 additions and 21 deletions

View File

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