Skip to main content

An easy-to-use pagination wrapper for discord.py

Project description

Pygicord

An easy-to-use pagination wrapper for discord.py

Lint Deploy PyPI - Python Version PyPI - Version PePy - Downloads

Notes

  • Make sure your bot has Manage Messages permission to take full advantage from the paginator.
  • It is recommended using the latest stable version of discord.py.

Installing

pip install pygicord

or via git: to download the latest version available (if not deployed already).

pip install git+https://github.com/davidetacchini/pygicord

Basic example

import discord
from discord.ext import commands

from pygicord import Paginator


bot = commands.Bot(command_prefix=".")


def get_pages():
    pages = []
    # Generate a list of 5 embeds
    for i in range(1, 6):
        embed = discord.Embed()
        embed.title = f"I'm the embed {i}!"
        pages.append(embed)
    return pages


@bot.command()
async def test(ctx):
    paginator = Paginator(pages=get_pages())
    await paginator.start(ctx)


@bot.event
async def on_ready():
    print("I'm ready!")


bot.run("token")

Attributes

Name Description Type Default
pages A list of embeds to paginate or an embed instance. List[discord.Embed], discord.Embed None
timeout The timeout to wait before stopping the paginator session. float 90.0
compact Whether to use three reactions: previous, stop and next. bool False
has_input Whether to add a reaction to enter a page number to go to. bool True
has_lock Whether to add a reaction to lock/unlock the session to other members. bool False

Project details


Download files

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

Source Distribution

pygicord-0.5.0.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

pygicord-0.5.0-py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 3

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