Skip to content

Commit

Permalink
add stop method to Paginator
Browse files Browse the repository at this point in the history
  • Loading branch information
krittick committed Jan 30, 2022
1 parent 572020c commit fb79fe7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions discord/ext/pages/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,13 @@ async def on_timeout(self) -> None:
item.disabled = True
await self.message.edit(view=self)

async def stop(self) -> None:
"""Stops the paginator, disabling all of its components. Does not disable components added via custom views."""
for item in self.children:
if isinstance(item, (PaginatorButton, PaginatorMenu)):
item.disabled = True
await self.message.edit(view=self)

async def goto_page(self, page_number=0) -> discord.Message:
"""Updates the paginator message to show the specified page number.
Expand Down

0 comments on commit fb79fe7

Please sign in to comment.