mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 11:48:55 -05:00
[V3 Help] Fix formatter field pagination (#1813)
* fix prefix * help formatter pagination fix * index comp fix
This commit is contained in:
parent
17c7dd658d
commit
d5f5ddbec5
@ -190,7 +190,11 @@ 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)
|
||||
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:
|
||||
@ -198,7 +202,7 @@ class Help(formatter.HelpFormatter):
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user