mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-21 16:52:31 -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:
@@ -18,7 +18,7 @@ import pip
|
||||
import traceback
|
||||
from pathlib import Path
|
||||
from redbot.core import data_manager
|
||||
from redbot.core.utils.menus import menu, DEFAULT_CONTROLS
|
||||
from redbot.core.utils.menus import menu
|
||||
from redbot.core.commands import GuildConverter, RawUserIdConverter
|
||||
from string import ascii_letters, digits
|
||||
from typing import TYPE_CHECKING, Union, Tuple, List, Optional, Iterable, Sequence, Dict, Set
|
||||
@@ -1659,7 +1659,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
|
||||
if len(pages) == 1:
|
||||
await ctx.send(pages[0])
|
||||
else:
|
||||
await menu(ctx, pages, DEFAULT_CONTROLS)
|
||||
await menu(ctx, pages)
|
||||
|
||||
@commands.command(require_var_positional=True)
|
||||
@checks.is_owner()
|
||||
|
||||
Reference in New Issue
Block a user