Skip to content

tldr

TLDR Paginator View.

A Discord UI view for paginating through long TLDR command documentation pages.

Classes:

Classes

TldrPaginatorView

Python
TldrPaginatorView(pages: list[str], title: str, user: User, bot: Tux)

Bases: View

Paginator view for navigating through long TLDR pages.

Initialize the TLDR paginator view.

Parameters:

  • pages (list[str]) –

    List of page content strings to paginate through.

  • title (str) –

    Title for the paginated content.

  • user (User) –

    User who can interact with this view.

  • bot (Tux) –

    Bot instance for embed creation.

Methods:

  • interaction_check

    Check if the interaction user is allowed to interact with this view.

  • on_timeout

    Handle view timeout by removing the view from the message.

  • prev

    Navigate to the previous page.

  • next

    Navigate to the next page.

  • update_message

    Update the message with the current page content.

Functions

interaction_check async
Python
interaction_check(interaction: Interaction) -> bool

Check if the interaction user is allowed to interact with this view.

Parameters:

  • interaction (Interaction) –

    The interaction to check.

Returns:

  • bool

    True if the user is allowed to interact.

on_timeout async
Python
on_timeout() -> None

Handle view timeout by removing the view from the message.

prev async
Python
prev(interaction: Interaction, button: Button[View])

Navigate to the previous page.

Parameters:

  • interaction (Interaction) –

    The interaction that triggered this action.

  • button (Button[View]) –

    The button that was pressed.

next async
Python
next(interaction: Interaction, button: Button[View])

Navigate to the next page.

Parameters:

  • interaction (Interaction) –

    The interaction that triggered this action.

  • button (Button[View]) –

    The button that was pressed.

update_message async
Python
update_message(interaction: Interaction) -> None

Update the message with the current page content.

Parameters:

  • interaction (Interaction) –

    The interaction to update the message for.