A Python library to easily create embed paginators in disnake
Find a file
2022-09-30 08:58:46 +02:00
src added await interaction.response.defer() 2022-02-17 09:51:51 +01:00
.gitignore Fixed next button actually being previous button... 2021-10-10 16:07:02 -04:00
LICENSE Create LICENSE 2021-09-12 08:52:39 -04:00
README.md Update README.md 2022-09-29 15:20:55 +02:00
setup.py Update setup.py 2022-02-17 09:52:05 +01:00

FORKED FROM: Pagination!

Please check support the original creation!

https://github.com/soosBot-com/Pagination

disnake-pagination

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

Installation

pip install git+https://github.com/SlumberDemon/disnake-Pagination

Usage

Quickstart

import Paginator

# Create a list of embeds to paginate.
embeds = [disnake.Embed(title="First embed"),
          disnake.Embed(title="Second embed"),
          disnake.Embed(title="Third embed")]

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

Advanced

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

PreviousButton = disnake.ui.Button(...)
NextButton = disnake.ui.Button(...)
PageCounterStyle = disnake.ButtonStyle(...) # Only accepts ButtonStyle instead of Button
InitialPage = 0 # Page to start the paginator on.
timeout = 42069 # Seconds to timeout. Default is 60

await Paginator.Simple(
    PreviousButton=PreviousButton,
    NextButton=NextButton,
    PageCounterStyle=PageCounterStyle,
    InitialPage=InitialPage,
    timeout=timeout).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