mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-16 18:59:09 +00:00
[commands] Fix crash when a group has no commands and help is requested
This commit is contained in:
parent
085e8d4eb3
commit
17e17cade9
@ -104,7 +104,9 @@ class HelpFormatter:
|
|||||||
the largest subcommand name."""
|
the largest subcommand name."""
|
||||||
try:
|
try:
|
||||||
commands = self.command.commands if not self.is_cog() else self.context.bot.commands
|
commands = self.command.commands if not self.is_cog() else self.context.bot.commands
|
||||||
|
if commands:
|
||||||
return max(map(lambda c: len(c.name), commands.values()))
|
return max(map(lambda c: len(c.name), commands.values()))
|
||||||
|
return 0
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return len(self.command.name)
|
return len(self.command.name)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user