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:
Jakub Kuczys
2022-04-16 21:29:12 +02:00
committed by GitHub
parent 955b40ac6d
commit 27bed5010f
15 changed files with 59 additions and 45 deletions

View File

@@ -9,7 +9,7 @@ import discord
from redbot.core import commands
from redbot.core.bot import Red
from redbot.core.i18n import Translator, cog_i18n
from redbot.core.utils.menus import menu, DEFAULT_CONTROLS
from redbot.core.utils.menus import menu
from redbot.core.utils.chat_formatting import (
bold,
escape,
@@ -511,7 +511,6 @@ class General(commands.Cog):
await menu(
ctx,
pages=embeds,
controls=DEFAULT_CONTROLS,
message=None,
page=0,
timeout=30,
@@ -537,7 +536,6 @@ class General(commands.Cog):
await menu(
ctx,
pages=messages,
controls=DEFAULT_CONTROLS,
message=None,
page=0,
timeout=30,