mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-05 17:02:32 -05:00
Make controls in menu() optional (#5678)
* Make `controls` in `menu()` optional You might wonder, shouldn't we pass `None` to functions from controls? No, we shouldn't because when `None` is passed, only DEFAULT_CONTROLS can be used and that means that the length of pages list won't change. * Update usage in core and core cogs * Add missing docstrings to `redbot.core.utils.menus` module
This commit is contained in:
@@ -309,7 +309,7 @@ class CustomCommands(commands.Cog):
|
||||
if len(msg) > 2000:
|
||||
msg = f"{msg[:1997]}..."
|
||||
msglist.append(msg)
|
||||
await menus.menu(ctx, msglist, menus.DEFAULT_CONTROLS)
|
||||
await menus.menu(ctx, msglist)
|
||||
|
||||
@customcom.command(name="search")
|
||||
@commands.guild_only()
|
||||
@@ -572,11 +572,11 @@ class CustomCommands(commands.Cog):
|
||||
)
|
||||
embed.set_footer(text=_("Page {num}/{total}").format(num=idx, total=len(pages)))
|
||||
embed_pages.append(embed)
|
||||
await menus.menu(ctx, embed_pages, menus.DEFAULT_CONTROLS)
|
||||
await menus.menu(ctx, embed_pages)
|
||||
else:
|
||||
content = "\n".join(map("{0[0]:<12} : {0[1]}".format, results))
|
||||
pages = list(map(box, pagify(content, page_length=2000, shorten_by=10)))
|
||||
await menus.menu(ctx, pages, menus.DEFAULT_CONTROLS)
|
||||
await menus.menu(ctx, pages)
|
||||
|
||||
@customcom.command(name="show")
|
||||
async def cc_show(self, ctx, command_name: str):
|
||||
|
||||
Reference in New Issue
Block a user