mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-08 04:08:56 -05:00
pagification (#1722)
This commit is contained in:
parent
92ca7c935a
commit
014e3baea0
@ -36,6 +36,7 @@ import sys
|
|||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
from . import commands
|
from . import commands
|
||||||
|
from redbot.core.utils.chat_formatting import pagify
|
||||||
|
|
||||||
|
|
||||||
EMPTY_STRING = u"\u200b"
|
EMPTY_STRING = u"\u200b"
|
||||||
@ -184,14 +185,18 @@ class Help(formatter.HelpFormatter):
|
|||||||
# Get list of commands for category
|
# Get list of commands for category
|
||||||
filtered = sorted(filtered)
|
filtered = sorted(filtered)
|
||||||
if filtered:
|
if filtered:
|
||||||
field = EmbedField(
|
for i, page in enumerate(
|
||||||
|
pagify(self._add_subcommands(filtered), page_length=1020)
|
||||||
|
):
|
||||||
|
title = (
|
||||||
"**__Commands:__**"
|
"**__Commands:__**"
|
||||||
if not self.is_bot() and self.is_cog()
|
if not self.is_bot() and self.is_cog()
|
||||||
else "**__Subcommands:__**",
|
else "**__Subcommands:__**"
|
||||||
self._add_subcommands(filtered), # May need paginated
|
|
||||||
False,
|
|
||||||
)
|
)
|
||||||
|
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)
|
emb["fields"].append(field)
|
||||||
|
|
||||||
return emb
|
return emb
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user