mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 03:38:53 -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,15 +190,19 @@ class Help(formatter.HelpFormatter):
|
|||||||
for category, commands_ in itertools.groupby(data, key=category):
|
for category, commands_ in itertools.groupby(data, key=category):
|
||||||
commands_ = sorted(commands_)
|
commands_ = sorted(commands_)
|
||||||
if len(commands_) > 0:
|
if len(commands_) > 0:
|
||||||
field = EmbedField(category, self._add_subcommands(commands_), False)
|
for i, page in enumerate(
|
||||||
emb["fields"].append(field)
|
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:
|
else:
|
||||||
# Get list of commands for category
|
# Get list of commands for category
|
||||||
filtered = sorted(filtered)
|
filtered = sorted(filtered)
|
||||||
if filtered:
|
if filtered:
|
||||||
for i, page in enumerate(
|
for i, page in enumerate(
|
||||||
pagify(self._add_subcommands(filtered), page_length=1020)
|
pagify(self._add_subcommands(filtered), page_length=1000)
|
||||||
):
|
):
|
||||||
title = (
|
title = (
|
||||||
"**__Commands:__**"
|
"**__Commands:__**"
|
||||||
@ -208,7 +212,6 @@ class Help(formatter.HelpFormatter):
|
|||||||
if i > 0:
|
if i > 0:
|
||||||
title += " (continued)"
|
title += " (continued)"
|
||||||
field = EmbedField(title, page, False)
|
field = EmbedField(title, page, False)
|
||||||
# This will still break at 6k total chars, hope that isnt an issue later
|
|
||||||
emb["fields"].append(field)
|
emb["fields"].append(field)
|
||||||
|
|
||||||
return emb
|
return emb
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user