Easily create pagination for discord.py embeds.
Project description
embed-pagination
Notes
This project is a fork of an inactive repository at https://github.com/soosBot-com/Pagination
Credit is due to the contributors of the original project.
New features 💡
- Added an option to delete paginator message upon timeout.
Installation
Use the package manager pip to install the library.
pip install git+https://github.com/FaddyManatee/embed-pagination
Usage
Important: discord.py master, or a form that has discord.ui.View is required to use this library!
Quickstart
import paginator
# Create a list of embeds to paginate.
embeds = [discord.Embed(title="First embed"),
discord.Embed(title="Second embed"),
discord.Embed(title="Third embed")]
... # Inside a command.
await paginator.Simple().start(ctx, pages=embeds)
Hint: The
ctx
parameter is of typediscord.Interaction
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 discord.ButtonStyle
InitialPage = 0 # Page to start the paginator on.
DeleteOnTimeout = True # Delete paginator message on timeout. Default is False.
timeout = 400 # Seconds to timeout. Default is 60.
ephemeral = True # Defaults to False if not passed in.
await paginator.Simple(
PreviousButton=PreviousButton,
NextButton=NextButton,
PageCounterStyle=PageCounterStyle,
InitialPage=InitialPage,
DeleteOnTimeout=DeleteOnTimeout,
timeout=timeout,
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.
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
Close
Hashes for simple-embed-pagination-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a576a97130866687f16b23695226c236c4a48efcb4f7f398f5d2f2a6962e94a4 |
|
MD5 | a58642695dc9f55aa0088a97dba51d91 |
|
BLAKE2b-256 | 5f39b2a94e76dd0c674fe223485e97e39f3dd2bd85dcf718f7fad52e7afc287f |
Close
Hashes for simple_embed_pagination-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01cab083b48f4f9a105e6526b137504695fed69aac9c9c19a18ccf82bcef4892 |
|
MD5 | cdee7fa3f6883f7d195b9a795be7879d |
|
BLAKE2b-256 | 1f082fd0465aa33b104dac71f257daddd2d47ea319655df5e423ebe3f041166e |