Skip to content

Commit c81355e

Browse files
committed
fix checking for paginator components
1 parent 132cd05 commit c81355e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

discord/ext/pages/pagination.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ def __init__(
273273
self.default_button_row = default_button_row
274274
self.loop_pages = loop_pages
275275
self.custom_view = custom_view
276+
self.custom_view_items = []
276277
self.message: Union[discord.Message, discord.WebhookMessage, None] = None
277278

278279
if self.custom_buttons and not self.use_default_buttons:
@@ -382,7 +383,7 @@ async def on_timeout(self) -> None:
382383
async def disable(self) -> None:
383384
"""Stops the paginator, disabling all of its components. Does not disable components added via custom views."""
384385
for item in self.children:
385-
if isinstance(item, (PaginatorButton, PaginatorMenu)):
386+
if item not in self.custom_view_items:
386387
item.disabled = True
387388
await self.message.edit(view=self)
388389

@@ -565,6 +566,7 @@ def update_buttons(self) -> Dict:
565566
# The bot developer should handle row assignments for their view before passing it to Paginator
566567
if self.custom_view:
567568
for item in self.custom_view.children:
569+
self.custom_view_items.append(item)
568570
self.add_item(item)
569571

570572
return self.buttons

0 commit comments

Comments
 (0)