aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-02-13 04:27:31 -0500
committerRapptz <[email protected]>2017-02-13 04:27:31 -0500
commitb6bff5172a99046c8d2a1aa017be0e4110c7fd24 (patch)
treea09bef8f149d385b611c2cdb7a8bd9e26d15cddd
parentDocumentation fixes for permission. (diff)
downloaddiscord.py-b6bff5172a99046c8d2a1aa017be0e4110c7fd24.tar.xz
discord.py-b6bff5172a99046c8d2a1aa017be0e4110c7fd24.zip
[commands] Remove Commands: if no commands can be run in help command.
-rw-r--r--discord/ext/commands/formatter.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/discord/ext/commands/formatter.py b/discord/ext/commands/formatter.py
index 070578ec..820a2529 100644
--- a/discord/ext/commands/formatter.py
+++ b/discord/ext/commands/formatter.py
@@ -364,8 +364,10 @@ class HelpFormatter:
self._add_subcommands_to_page(max_width, commands)
else:
- self._paginator.add_line('Commands:')
- self._add_subcommands_to_page(max_width, sorted(filtered))
+ filtered = sorted(filtered)
+ if filtered:
+ self._paginator.add_line('Commands:')
+ self._add_subcommands_to_page(max_width, filtered)
# add the ending note
self._paginator.add_line()