Skip to content

Commit fde38c1

Browse files
authored
fix: Don't show pagination buttons if only 1 page (#24)
1 parent df473fb commit fde38c1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

nextcord/ext/menus/menu_pages.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ async def change_source(self, source: PageSource):
6767
def should_add_reactions(self) -> bool:
6868
return self.should_add_reactions_or_buttons()
6969

70+
def should_add_buttons(self) -> bool:
71+
return self.should_add_reactions_or_buttons()
72+
7073
def should_add_reactions_or_buttons(self) -> bool:
7174
return self._source.is_paginating()
7275

@@ -268,8 +271,8 @@ def __init__(
268271
if "disable_buttons_after" not in kwargs:
269272
kwargs["disable_buttons_after"] = True
270273
super().__init__(source, **kwargs)
271-
# skip adding buttons if inherit_buttons=False was passed to metaclass
272-
if not self.__inherit_buttons__:
274+
# skip adding buttons if inherit_buttons=False was passed to metaclass or only one page
275+
if not self.__inherit_buttons__ or not self.should_add_buttons():
273276
return
274277
# add buttons to the view
275278
pagination_emojis = (

0 commit comments

Comments
 (0)