aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/ext/commands/formatter.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/discord/ext/commands/formatter.py b/discord/ext/commands/formatter.py
index 396eb359..1ead32c4 100644
--- a/discord/ext/commands/formatter.py
+++ b/discord/ext/commands/formatter.py
@@ -142,11 +142,20 @@ class HelpFormatter:
width: :class:`int`
The maximum number of characters that fit in a line.
Defaults to 80.
+ commands_heading: :class:`str`
+ The command list's heading string used when the help command is invoked with a category name.
+ Useful for i18n. Defaults to ``"Commands:"``
+ no_category: :class:`str`
+ The string used when there is a command which does not belong to any category(cog).
+ Useful for i18n. Defaults to ``"No Category"``
"""
- def __init__(self, show_hidden=False, show_check_failure=False, width=80):
+ def __init__(self, show_hidden=False, show_check_failure=False, width=80,
+ commands_heading="Commands:", no_category="No Category"):
self.width = width
self.show_hidden = show_hidden
self.show_check_failure = show_check_failure
+ self.commands_heading = commands_heading
+ self.no_category = no_category
def has_subcommands(self):
""":class:`bool`: Specifies if the command has subcommands."""
@@ -317,7 +326,7 @@ class HelpFormatter:
cog = tup[1].cog_name
# we insert the zero width space there to give it approximate
# last place sorting position.
- return cog + ':' if cog is not None else '\u200bNo Category:'
+ return cog + ':' if cog is not None else '\u200b' + self.no_category + ':'
filtered = await self.filter_command_list()
if self.is_bot():
@@ -332,7 +341,7 @@ class HelpFormatter:
else:
filtered = sorted(filtered)
if filtered:
- self._paginator.add_line('Commands:')
+ self._paginator.add_line(self.commands_heading)
self._add_subcommands_to_page(max_width, filtered)
# add the ending note