Skip to main content

Easily create pagination for your embeds.

Project description

discord.py-pagination

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

WARNING IMAGE NOT FOUND

Installation

Use the package manager pip to install the library.

pip install discord.py-pagination

Usage

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)

Advanced

To use custom buttons, pass in the corresponding argument when you initiate the paginator.
# 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.
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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

discord.py_pagination-0.0.4-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file discord.py_pagination-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for discord.py_pagination-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6a74c75b072bdde92dd03a5bfb2889fab61f2aca0d3ac4e95630c15c188d490b
MD5 103f8cf579992e3165045ab9ed2edb3a
BLAKE2b-256 ae144c68b373bdb74c5ea259b73d8ad63090aaee28c162fad11d24efee4769bf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page