Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass timeout to SimpleMenu #6173

Merged
merged 4 commits into from Jun 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions redbot/core/utils/menus.py
Expand Up @@ -110,6 +110,7 @@ async def menu(
view._source = _SimplePageSource(pages)
new_page = await view.get_page(page)
view.current_page = page
view.timeout = timeout
await view.message.edit(**new_page)
return
if not isinstance(pages[0], (discord.Embed, str)):
Expand Down Expand Up @@ -137,12 +138,12 @@ async def menu(
# This is not normally the way we recommend sending this because
# internally we already include the emojis we expect.
if controls == DEFAULT_CONTROLS:
view = SimpleMenu(pages)
view = SimpleMenu(pages, timeout=timeout)
await view.start(ctx)
await view.wait()
return
else:
view = SimpleMenu(pages)
view = SimpleMenu(pages, timeout=timeout)
view.remove_item(view.last_button)
view.remove_item(view.first_button)
has_next = False
Expand Down