aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2018-07-07 15:11:26 +0200
committerGravatar Johannes Christ <[email protected]>2018-07-07 15:11:26 +0200
commit80fa51b841dedfe66a396232b3abc29eb8991395 (patch)
treea2dee0fddd6f3634e2f3c8b7e243eefc99dfe949
parentFix incorrect log line (diff)
Paginate and sort `bot.docs.get` output.
-rw-r--r--bot/cogs/doc.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/bot/cogs/doc.py b/bot/cogs/doc.py
index 26079e3ec..e6d108720 100644
--- a/bot/cogs/doc.py
+++ b/bot/cogs/doc.py
@@ -17,6 +17,7 @@ from sphinx.ext import intersphinx
from bot.constants import ERROR_REPLIES, Keys, Roles, URLs
from bot.converters import ValidPythonIdentifier, ValidURL
from bot.decorators import with_role
+from bot.pagination import LinePaginator
log = logging.getLogger(__name__)
@@ -371,15 +372,13 @@ class Doc:
"""
if symbol is None:
- all_inventories = "\n".join(
- f"• [`{name}`]({url})" for name, url in self.base_urls.items()
- )
inventory_embed = discord.Embed(
- title="All inventories",
- description=all_inventories or "*Seems like there's nothing here yet.*",
+ title=f"All inventories (`{len(self.base_urls)}` total)",
colour=discord.Colour.blue()
)
- await ctx.send(embed=inventory_embed)
+
+ lines = sorted(f"• [`{name}`]({url})" for name, url in self.base_urls.items())
+ await LinePaginator.paginate(lines, ctx, inventory_embed, max_size=400, empty=False)
else:
# Fetching documentation for a symbol (at least for the first time, since