Skip to content

Marseel-E/discord.py-paginator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord server Discord.py Supported Python versions

discord.py-paginator

Buttons pagination template for discord bots.

Useage

Install via pip.

py -m pip install -U discord.py-paginator

:: for latest/unstable
py -m pip install -U git+https://github.com/Marseel-E/discord.py-paginator

or

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):
    pages = []
    page_content = ""
    
    for i in range(15):
        if (i > 0) and (i % 5 == 0):
            pages.append(page_content)
            page_content = ""

        page_content += f"{i+1}. Item `{i}`\n"

    if (page_content != "") and not (page_content in pages): pages.append(page_content)
        
    await Paginator(interaction, pages).start()

Preview

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

📜 LICENSE

About

Buttons pagination template for discord bots.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages