mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 03:38:53 -05:00
pagification (#1722)
This commit is contained in:
parent
92ca7c935a
commit
014e3baea0
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user