Skip to content
Merged
Show file tree
Hide file tree
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
32 changes: 17 additions & 15 deletions discord/ext/pages/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,6 @@ async def callback(self, interaction: discord.Interaction):
class Paginator(discord.ui.View):
"""Creates a paginator which can be sent as a message and uses buttons for navigation.

Attributes
----------
current_page: :class:`int`
A zero-indexed value showing the current page number.
page_count: :class:`int`
A zero-indexed value showing the total number of pages.
buttons: Dict[:class:`str`, Dict[:class:`str`, Union[:class:`~PaginatorButton`, :class:`bool`]]]
A dictionary containing the :class:`~PaginatorButton` objects included in this paginator.
user: Optional[Union[:class:`~discord.User`, :class:`~discord.Member`]]
The user or member that invoked the paginator.
message: Union[:class:`~discord.Message`, :class:`~discord.WebhookMessage`]
The message the paginator is attached to.

Parameters
----------
pages: Union[List[:class:`str`], List[:class:`discord.Embed`]]
Expand All @@ -89,9 +76,24 @@ class Paginator(discord.ui.View):
author_check: :class:`bool`
Whether only the original user of the command can change pages.
disable_on_timeout: :class:`bool`
Whether the buttons get disabled when the pagintator view times out.
Whether the buttons get disabled when the paginator view times out.
custom_view: Optional[:class:`discord.ui.View`]
A custom view whose items are appended below the pagination buttons.
timeout: Optional[:class:`float`]
Timeout in seconds from last interaction with the paginator before no longer accepting input.

Attributes
----------
current_page: :class:`int`
A zero-indexed value showing the current page number.
page_count: :class:`int`
A zero-indexed value showing the total number of pages.
buttons: Dict[:class:`str`, Dict[:class:`str`, Union[:class:`~PaginatorButton`, :class:`bool`]]]
A dictionary containing the :class:`~PaginatorButton` objects included in this paginator.
user: Optional[Union[:class:`~discord.User`, :class:`~discord.Member`]]
The user or member that invoked the paginator.
message: Union[:class:`~discord.Message`, :class:`~discord.WebhookMessage`]
The message the paginator is attached to.
"""

def __init__(
Expand Down Expand Up @@ -187,7 +189,7 @@ async def goto_page(self, interaction: discord.Interaction, page_number=0) -> No
Parameters
----------
interaction: :class:`discord.Interaction`
The interaction which called the Paginator
The interaction that invoked the paginator.
page_number: :class:`int`
The page to display.

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
'discord_extensions': [
('discord.ext.commands', 'ext/commands'),
('discord.ext.tasks', 'ext/tasks'),
('discord.ext.menus', 'ext/menus'),
('discord.ext.pages', 'ext/pages'),
],
}

Expand Down