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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dpy_container_pagination-0.1.1.tar.gz.
File metadata
- Download URL: dpy_container_pagination-0.1.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71491e6ef9d0a153e63fb1077de2cd819814cbcde0e15627c9a188c7599e3c51
|
|
| MD5 |
c7edd72e63c772e9d6d88ff57a9fff4b
|
|
| BLAKE2b-256 |
9af35c561d18ebbbd7ec80c3bdbbe8ee177cf7817b1fb0170aaecf1440d83a39
|
File details
Details for the file dpy_container_pagination-0.1.1-py3-none-any.whl.
File metadata
- Download URL: dpy_container_pagination-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d163ba189b7de32414bf2edebc9ba860757ae710b5cae46776a838f133f7d225
|
|
| MD5 |
2326b24fedb47fee2caa51b8c3da5386
|
|
| BLAKE2b-256 |
d440a403ad877034b1c7df594f72e4cd08e58feed20529a148f6792c4fe42dcb
|