Skip to content

Commit fb79fe7

Browse files
committed
add stop method to Paginator
1 parent 572020c commit fb79fe7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

discord/ext/pages/pagination.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,13 @@ async def on_timeout(self) -> None:
379379
item.disabled = True
380380
await self.message.edit(view=self)
381381

382+
async def stop(self) -> None:
383+
"""Stops the paginator, disabling all of its components. Does not disable components added via custom views."""
384+
for item in self.children:
385+
if isinstance(item, (PaginatorButton, PaginatorMenu)):
386+
item.disabled = True
387+
await self.message.edit(view=self)
388+
382389
async def goto_page(self, page_number=0) -> discord.Message:
383390
"""Updates the paginator message to show the specified page number.
384391

0 commit comments

Comments
 (0)