@drowsy nest You were really helpful a few months ago with helping set up a persistent paginator. Now I'm trying to add pages based on player input from my db, as you suggested here: #998272089343668364 message
The crux of my question now is that since I'm creating pages in a function with lots of if/else logic, I'm unsure as to how to add the pages to the bot and on_ready.
Here's the general idea:
The slash command to create the user's paginator from their db values
@bot.slash_command(name="postPaginator")
[read db values, push to 'result']
if ...:
paginator = pages.Paginator(pages=[
pages.Page(result[0][2] + "text",
files=[firstPageImage]),
pages.Page(result[0][3]+ "text", files=[secondPageImage])],
loop_pages=False, use_default_buttons=False
)
if ...::
paginator = pages.Paginator(pages=[
pages.Page(result[0][5] + "text",
files=[firstPageImage]),
pages.Page(result[0][6] + "text", files=[secondPageImage]),
pages.Page(result[0][7] + "text", files=[thirdPageImage])],
loop_pages=False, use_default_buttons=False
)
paginator.add_button(
CustomButtons("prev", label="<", custom_id="paginator1 + [uniqueid from db]", style=discord.ButtonStyle.green))
paginator.add_button(
CustomButtons("page_indicator", custom_id="paginator + [uniqueid from db]", style=discord.ButtonStyle.gray, disabled=True))
paginator.add_button(
CustomButtons("next", label=">", custom_id="paginator + [uniqueid from db]", style=discord.ButtonStyle.green))
paginator.timeout = None
#custom ids need to include uniqueid from db.
await paginator.respond(ctx.interaction)