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 new on_timeout options
- Added buttons for first/last page
- Improved button layout
- Many more general improvements
Installation
Use the package manager pip to install the library.
pip install simple-embed-pagination
Usage
Important:
discord.py master, or a form that has discord.ui.View is required to use this library!
Quickstart
import paginator
embeds = [discord.Embed(title="First embed"),
discord.Embed(title="Second embed"),
discord.Embed(title="Third embed")]
...
await paginator.Simple().start(ctx, pages=embeds)
Hint:
The ctx
parameter is of type discord.Interaction
Advanced
To use custom buttons, pass in the corresponding argument when you initiate the paginator. THESE ARE OPTIONAL
PreviousButton = discord.ui.Button(...)
NextButton = discord.ui.Button(...)
PageCounterStyle = discord.ButtonStyle(...)
InitialPage = 0
OnTimeout = 'disable_view'
timeout = 400
ephemeral = True
FirstButton = discord.ui.Button(...)
LastButton = discord.ui.Button(...)
await paginator.Simple(
previous_button=">",
next_buttom=NextButton,
page_counter_style=PageCounterStyle,
initial_page=InitialPage,
allow_ext_input=True,
on_timeout=DeleteOnTimeout,
timeout=timeout,
ephemeral=ephemeral,
first_button=FirstButton,
last_button=LastButton
).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
MIT