An easy-to-use pagination wrapper for discord.py
Project description
Pygicord
An easy-to-use pagination wrapper for discord.py
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
Release history Release notifications | RSS feed
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)