diff options
| -rw-r--r-- | bot/cogs/tags.py | 9 | ||||
| -rw-r--r-- | bot/formatter.py | 7 |
2 files changed, 15 insertions, 1 deletions
diff --git a/bot/cogs/tags.py b/bot/cogs/tags.py index 1c8f54d9f..a7c6b0248 100644 --- a/bot/cogs/tags.py +++ b/bot/cogs/tags.py @@ -251,11 +251,18 @@ class Tags: # Paginate if this is a list of all tags if tags: + if ctx.invoked_with == "tags.keys()": + detail_invocation = "bot.tags[<tagname>]" + elif ctx.invoked_with == "tags.get()": + detail_invocation = "bot.tags.get(<tagname>)" + else: + detail_invocation = "bot.tags.get <tagname>" + log.debug(f"Returning a paginated list of all tags.") return await LinePaginator.paginate( (lines for lines in tags), ctx, embed, - footer_text="To show a tag, type bot.tags.get <tagname>.", + footer_text=f"To show a tag, type {detail_invocation}.", empty=False, max_lines=15 ) diff --git a/bot/formatter.py b/bot/formatter.py index f46aaa685..7c966108a 100644 --- a/bot/formatter.py +++ b/bot/formatter.py @@ -35,6 +35,13 @@ class Formatter(HelpFormatter): shortened = self.shorten(entry) self._paginator.add_line(shortened) + if name.endswith('get()'): + alternate_syntax_entry = " {0}{1:<{width}} # {2}".format( + HELP_PREFIX, name.split('.')[0] + '[<arg>]', + f"Alternative syntax for {name}", width=max_width + ) + self._paginator.add_line(self.shorten(alternate_syntax_entry)) + async def format(self): """ rewritten help command to make it more python-y |