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.0.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.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for dpy_container_pagination-0.1.0.tar.gz
Algorithm Hash digest
SHA256 210cbbb8e2122b232c5ea5fb8606710e30d7325d27e4bd7a6fdf863f4a20604b
MD5 e627500f4a1ca63d62259ffdb357c0ff
BLAKE2b-256 1ac6839fd8cd72fc68e66850b940c1cd2479f0fba2174230ef28523a9ee55471

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dpy_container_pagination-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15c0a31c4c5388b5a06a901cbff97304987918cbe38cc6715534e2157395496a
MD5 5b705c56f1fff8b41b71cae79376801c
BLAKE2b-256 262a3475e59ad114be5afbb186e9a5f08b4412b5eed3122893c0f3258cbfe115

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