pagification (#1722)

This commit is contained in:
Michael H 2018-05-27 21:35:57 -04:00 committed by Kowlin
parent 92ca7c935a
commit 014e3baea0

View File

@ -36,6 +36,7 @@ import sys
import traceback
from . import commands
from redbot.core.utils.chat_formatting import pagify
EMPTY_STRING = u"\u200b"
@ -184,15 +185,19 @@ class Help(formatter.HelpFormatter):
# Get list of commands for category
filtered = sorted(filtered)
if filtered:
field = EmbedField(
"**__Commands:__**"
if not self.is_bot() and self.is_cog()
else "**__Subcommands:__**",
self._add_subcommands(filtered), # May need paginated
False,
)
emb["fields"].append(field)
for i, page in enumerate(
pagify(self._add_subcommands(filtered), page_length=1020)
):
title = (
"**__Commands:__**"
if not self.is_bot() and self.is_cog()
else "**__Subcommands:__**"
)
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