Skip to main content

Easily create pagination for your containers.

Project description

dpy-container-pagination

The library originated from discord.py-pagination.

dpy-container-pagination is a Python library to easily create embed paginators.

Installation

Use the package manager pip to install the library.

pip install dpy-container-pagination

Usage

Quickstart

import Paginator

# Create a list of containers to paginate.
containers = [discord.ui.Container().add_item(discord.ui.TextDisplay("First container")),
          discord.ui.Container().add_item(discord.ui.TextDisplay("Second container")),
          discord.ui.Container().add_item(discord.ui.TextDisplay("Third container"))]

... # Inside a command.
await Paginator.Simple().start(ctx, pages=containers)

Advanced

To use custom buttons, pass in the corresponding argument when you initiate the paginator. THESE ARE OPTIONAL
# These arguments override the default ones.

PreviousButton = discord.ui.Button(...)
NextButton = discord.ui.Button(...)
PageCounterStyle = discord.ButtonStyle(...) # Only accepts ButtonStyle instead of Button
InitialPage = 0 # Page to start the paginator on.
ephemeral = true # Defaults to false if not passed in.

await Paginator.Simple(
    PreviousButton=PreviousButton,
    NextButton=NextButton,
    PageCounterStyle=PageCounterStyle,
    InitialPage=InitialPage,
    ephemeral=ephemeral).start(ctx, pages=embeds)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dpy_container_pagination-0.1.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dpy_container_pagination-0.1.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file dpy_container_pagination-0.1.1.tar.gz.

File metadata

File hashes

Hashes for dpy_container_pagination-0.1.1.tar.gz
Algorithm Hash digest
SHA256 71491e6ef9d0a153e63fb1077de2cd819814cbcde0e15627c9a188c7599e3c51
MD5 c7edd72e63c772e9d6d88ff57a9fff4b
BLAKE2b-256 9af35c561d18ebbbd7ec80c3bdbbe8ee177cf7817b1fb0170aaecf1440d83a39

See more details on using hashes here.

File details

Details for the file dpy_container_pagination-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for dpy_container_pagination-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d163ba189b7de32414bf2edebc9ba860757ae710b5cae46776a838f133f7d225
MD5 2326b24fedb47fee2caa51b8c3da5386
BLAKE2b-256 d440a403ad877034b1c7df594f72e4cd08e58feed20529a148f6792c4fe42dcb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page