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

fix: should_add_reactions returning true for Button menu #33

Merged
merged 4 commits into from
Feb 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions nextcord/ext/menus/menu_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,10 @@ async def change_source(self, source: PageSource):
await self.show_page(0)

def should_add_reactions(self) -> bool:
return self.should_add_reactions_or_buttons()
return super().should_add_reactions() and self._source.is_paginating()

def should_add_buttons(self) -> bool:
return self.should_add_reactions_or_buttons()

def should_add_reactions_or_buttons(self) -> bool:
return self._source.is_paginating()
return super().should_add_buttons() and self._source.is_paginating()

async def _get_kwargs_from_page(self, page: List[Any]) -> SendKwargsType:
"""|coro|
Expand Down Expand Up @@ -324,6 +321,9 @@ def __init__(
# disable buttons that are not available
self._disable_unavailable_buttons()

def should_add_buttons(self) -> bool:
return self._source.is_paginating()

async def show_page(self, page_number: int):
"""|coro|
Sets the current page to the specified page and shows it.
Expand Down