mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-06 01:12:33 -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:
@@ -9,7 +9,7 @@ from redbot.core import checks, commands, modlog
|
||||
from redbot.core.bot import Red
|
||||
from redbot.core.i18n import Translator, cog_i18n
|
||||
from redbot.core.utils.chat_formatting import bold, box, pagify
|
||||
from redbot.core.utils.menus import DEFAULT_CONTROLS, menu
|
||||
from redbot.core.utils.menus import menu
|
||||
from redbot.core.utils.predicates import MessagePredicate
|
||||
|
||||
_ = Translator("ModLog", __file__)
|
||||
@@ -84,7 +84,7 @@ class ModLog(commands.Cog):
|
||||
)
|
||||
rendered_cases.append(message)
|
||||
|
||||
await menu(ctx, rendered_cases, DEFAULT_CONTROLS)
|
||||
await menu(ctx, rendered_cases)
|
||||
|
||||
@commands.command()
|
||||
@commands.guild_only()
|
||||
@@ -119,7 +119,7 @@ class ModLog(commands.Cog):
|
||||
)
|
||||
for page in pagify(message, ["\n\n", "\n"], priority=True):
|
||||
rendered_cases.append(page)
|
||||
await menu(ctx, rendered_cases, DEFAULT_CONTROLS)
|
||||
await menu(ctx, rendered_cases)
|
||||
|
||||
@commands.command()
|
||||
@commands.guild_only()
|
||||
|
||||
Reference in New Issue
Block a user