Skip to main content

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 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

# 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 type discord.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.
OnTimeout = 'disable_view' # 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.
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

Metadata

Release files for simple-embed-pagination 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simple-embed-pagination 1.0.2
File Size Uploaded
simple-embed-pagination-1.0.2.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simple-embed-pagination 1.0.2
File Interpreter ABI Platform
simple_embed_pagination-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 9.9 kB

Release files / simple-embed-pagination-1.0.2.tar.gz

Download URL simple-embed-pagination-1.0.2.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d2f8895e34a5a037f76d0f44bb19d2c9449e73e6ee619cd3490e0ed31da4a166
BLAKE2b-256 checksum
How to use checksums
d3ebfbc5d693bd7d656197973bfac53dc3ff1f14b766ee02b40a418a591a6660
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / simple_embed_pagination-1.0.2-py3-none-any.whl

Download URL simple_embed_pagination-1.0.2-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c89f2439637255cc8f86afbb99056f289050db8ce5ee9b6376c8690c526d9386
BLAKE2b-256 checksum
How to use checksums
a634099cb7f52f65f675a46fb06d53f0637d73353b9a1169412d5b2505d5fad1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page