#Callbacks not triggering for PageButtons

1 messages · Page 1 of 1 (latest)

charred idol
#

I have a paginator that I'm using to replace the message a different paginator is in via the Paginator.edit method. When I hit the custom ui.Button button on Paginator 1, it gladly edits the message to Paginator 2. Paginator 2 has three buttons: a back PaginatorButton, a next PaginatorButton, and a custom subclassed BackButton PaginatorButton which is supposed to bring you back to Paginator 1. However, None of the three custom buttons on Paginator 2 work. I did some testing and learned that the button callbacks aren't being called at all.

#

Here is my code to initialize Paginator 2:

paginator = Paginator(
    pages=pages,
    author_check=True,
    use_default_buttons=False,
    show_indicator=False,
    loop_pages=False,
    disable_on_timeout=True,
    trigger_on_display=False,
    custom_buttons=[
        BackButton(self.vw),
        PB(
            button_type="prev",
            emoji=self.vw.parent.bot.emoji.arrow_left,
            style=ButtonStyle.grey
        ),
        PB(
            button_type="next",
            emoji=self.vw.parent.bot.emoji.arrow_right,
            style=ButtonStyle.grey
        ),
    ],
)```
#

And here is my BackButton:

class BackButton(PB):
    def __init__(self, view):
        super().__init__(
            button_type="none",
            emoji=view.parent.bot.emoji.cancel,
            style=ButtonStyle.red
        )
        self.vw = view

    async def callback(self, inter: Interaction):
        print("Entered Callback")
        await self.vw.parent.edit(inter.message)
        await inter.response.defer()
        print("Finished Callback")```
#

I would share the code for Paginator 1, but I don't believe it to be the issue and it's heavily subclassed and modified so it would not fit here.

charred idol
#

Nothing?

keen carbon
#

@charred idol Maybe try going to the ext.pages mega thread so Krittic could help, he’s the big brain for ext.pages because he made it doggokek

#

The code seems correct to me, but I haven’t used PageButtons

charred idol
keen carbon
#

Oh I see

charred idol
#

Yeah

#

Sadly it isn't the easiest getting help in separate threads

blazing flicker
#

Will take a look as soon as I can

charred idol
#

Alright cool

#

It seems to only happen when using the edit method

#

I tried to take a look at the code itself but couldn't find out where button presses were handled