Lets learn how you can create paginator using slash commands bot
Md Shahriyar Alam
2 years ago
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.
We will make a command named pagination and put the following code inside Hooks (pre)
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()If you followed the instructions above you will get the following output
Loading comments…
Have a question, a suggestion, or stuck on something? Reach out — we're happy to help.