mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
[V3] fix help on missing cog and command docstrings (#1645)
* [V3] fix help on missing cog docstrings * I think this is what you're looking for * Also do a NoneType check for commands
This commit is contained in:
parent
cbbeb412f9
commit
e7476edd68
@ -38,7 +38,10 @@ class Command(commands.Command):
|
||||
translator = lambda s: s
|
||||
else:
|
||||
translator = self.translator
|
||||
return inspect.cleandoc(translator(self.callback.__doc__))
|
||||
command_doc = self.callback.__doc__
|
||||
if command_doc is None:
|
||||
return ''
|
||||
return inspect.cleandoc(translator(command_doc))
|
||||
|
||||
@help.setter
|
||||
def help(self, value):
|
||||
|
||||
@ -136,7 +136,11 @@ class Help(formatter.HelpFormatter):
|
||||
|
||||
if self.is_cog():
|
||||
translator = getattr(self.command, '__translator__', lambda s: s)
|
||||
description = inspect.cleandoc(translator(self.command.__doc__))
|
||||
description = (
|
||||
inspect.cleandoc(translator(self.command.__doc__))
|
||||
if self.command.__doc__
|
||||
else EMPTY_STRING
|
||||
)
|
||||
else:
|
||||
description = self.command.description
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user