Custom Commands homeCustom Commands
  • PremiumPremium
  • TemplatesTemplates
  • CompareCompare
  • BlogBlog
  • SupportSupport
Back to blog

How to create pagination in Custom Commands bot

Lets learn how you can create paginator using slash commands bot

Md Shahriyar Alam

2 years ago

1 min read

Code

py
pages = Paginator(
    interaction, 
    user_id=user.id,
    prev_text="Prev",
    next_text="Next",
    stop_text="Stop",
)

pages.add_page(
    Page(
        content="",
        embed=embed, # you can use load_embed()
        message=Message(), # see docs for custom message
        attachments=[], # list of attachments 
    )   
)
# add as many pages as you want

await pages.start()

Now running the command will show a paginator.

Example

We will make a command named pagination and put the following code inside Hooks (pre)

py
pages = Paginator(interaction, user_id=user.id)

pages.add_page(Page(content="This is page 1"))
pages.add_page(Page(content="This is page 2"))

await pages.start()

Creating pagination is simple using Discord Custom Commands bot

If you followed the instructions above you will get the following output example

Loading comments…

Need help?

Have a question, a suggestion, or stuck on something? Reach out — we're happy to help.

Join support server
Custom CommandsCustom Commands

The #1 Custom Commands Discord bot — commands, tickets, forms and levels, all from one dashboard.

Join the support server

Product

  • Overview
  • Why us?
  • Premium
  • Template shop

Community

  • Leveling
  • Global leaderboard
  • Welcome messages
  • Reaction roles
  • Social alerts
  • Voice recording

Server tools

  • AI Agent
  • Tickets
  • Forms
  • Auto moderation
  • Embed builder
  • Custom bot

Resources

  • Docs
  • Blog
  • Support
  • Dashboard
contact@ccbot.app

2 Frederick Street, London, WC1X 0ND

Payments secured by Stripe

PrivacyTerms© WEiRDSOFT LTD. All rights reserved.

Custom Commands