From d5f5ddbec57d466a94c794939e97707464738b4b Mon Sep 17 00:00:00 2001 From: Michael H Date: Fri, 8 Jun 2018 21:02:28 -0400 Subject: [PATCH] [V3 Help] Fix formatter field pagination (#1813) * fix prefix * help formatter pagination fix * index comp fix --- redbot/core/help_formatter.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/redbot/core/help_formatter.py b/redbot/core/help_formatter.py index 1cedb756c..6e649c79d 100644 --- a/redbot/core/help_formatter.py +++ b/redbot/core/help_formatter.py @@ -190,15 +190,19 @@ class Help(formatter.HelpFormatter): for category, commands_ in itertools.groupby(data, key=category): commands_ = sorted(commands_) if len(commands_) > 0: - field = EmbedField(category, self._add_subcommands(commands_), False) - emb["fields"].append(field) + for i, page in enumerate( + pagify(self._add_subcommands(commands_), page_length=1000) + ): + title = category if i < 1 else f"{category} (continued)" + field = EmbedField(title, page, False) + emb["fields"].append(field) else: # Get list of commands for category filtered = sorted(filtered) if filtered: for i, page in enumerate( - pagify(self._add_subcommands(filtered), page_length=1020) + pagify(self._add_subcommands(filtered), page_length=1000) ): title = ( "**__Commands:__**" @@ -208,7 +212,6 @@ class Help(formatter.HelpFormatter): if i > 0: title += " (continued)" field = EmbedField(title, page, False) - # This will still break at 6k total chars, hope that isnt an issue later emb["fields"].append(field) return emb