async def _transform_command_help(self, command: commands.Command): await self.bot.wait_until_ready() format_mapping = self.bot.mk.to_dict() format_mapping["COMMAND"] = command.qualified_name format_mapping["PREFIX"] = config.BOT_PREFIX command.help = command.help.format_map(format_mapping)
def kaz_preprocess(self, command: commands.Command, bot: commands.Bot): if command is not bot: # command or cog - not the bot itself try: data = self.parser.parse(command, bot) except NotKazhelpError: logger.info("Non-!kazhelp for command '{!s}'".format(command)) else: logger.debug("Parsed !kazhelp for command '{!s}'".format(command)) if isinstance(command, commands.Command): command.description = self._format_links(self._fix_paragraphs(data['description'])) command.brief = self._format_links(self._fix_paragraphs(data['brief'] or data['description'])) command.help = self._format_links(self._build_detailed_info(data)) if isinstance(command, commands.GroupMixin): command.help += '\n\n' + self._make_title("SUB-COMMANDS") else: # cog command.__doc__ = self._format_links( self._fix_paragraphs(data['description']) + '\n\n' + self._build_detailed_info(data) )