Skip to main content

A button & interactions pagination template for discord bots coded in discord.py

Project description

Discord server Discord.py Supported Python versions

discord.py-paginator

Buttons pagination template for discord bots.

Useage

Download this folder and place it in your project directory. (or clone it with the following command)

git clone https://github.com/Marseel-E/discord.py-paginator

Example

import discord
from paginator import Paginator


@discord.app_commands.command()
async def command_name(interaction: discord.Interaction):
    data = {...}
    pages = []
    page_content = ""

    for i, (key, value) in enumerate(data.items()):
        if (i > 0) and (i + 1 % 5 == 0):
            pages.append(page_content)

            page_content += f"{i+1}. {key.capitalize()} `{value}`\n")

    await Paginator(interaction, pages).start()

Preview

layout-preview quick-navigation-preview custom-children-preview

:scroll: LICENSE

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

discord.py-paginator-1.0.0.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

discord.py_paginator-1.0.0-py3-none-any.whl (4.7 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