mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -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:
@@ -115,10 +115,22 @@ class RedBase(commands.GroupMixin, commands.bot.BotBase, RPCMixin):
|
||||
|
||||
self.cog_mgr = CogManager()
|
||||
|
||||
super().__init__(*args, help_command=commands.DefaultHelpCommand(), **kwargs)
|
||||
super().__init__(*args, help_command=None, **kwargs)
|
||||
# Do not manually use the help formatter attribute here, see `send_help_for`,
|
||||
# for a documented API. The internals of this object are still subject to change.
|
||||
self._help_formatter = commands.help.RedHelpFormatter()
|
||||
self.add_command(commands.help.red_help)
|
||||
|
||||
self._permissions_hooks: List[commands.CheckPredicate] = []
|
||||
|
||||
async def send_help_for(
|
||||
self, ctx: commands.Context, help_for: Union[commands.Command, commands.GroupMixin, str]
|
||||
):
|
||||
"""
|
||||
Invokes Red's helpformatter for a given context and object.
|
||||
"""
|
||||
return await self._help_formatter.send_help(ctx, help_for)
|
||||
|
||||
async def _dict_abuse(self, indict):
|
||||
"""
|
||||
Please blame <@269933075037814786> for this.
|
||||
|
||||
Reference in New Issue
Block a user