#Paginator Broke with Update to v2.7.0

1 messages · Page 1 of 1 (latest)

loud valley
#

I have recently updated my pycord to v2.7.0 to start working with components v2 but after the update it broke some commands using Paginator and PageGroups.
await Paginator(pages=[PageGroup(pages=["hi", "hit", "wah"], label="thing"), PageGroup(pages=["fi", "fit", "fah"], label="thinfdg")], show_menu=True).respond(ctx.interaction)
The aboth example is a simplified version of all the ones that broke and causes the following error:
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'Page' object has no attribute 'label'
Normal Paginators without page groups or setting show_menu to False work fine.
Hence my question: Has any1 else experienced this/found a way to fix it, or do i have to go back to older versions?
Ty for your response in advance

hot frigate
#

Is that without any code changes from what worked in 2.6.1?

loud valley
#

Yes, I just returned to v2.6.1 and ran it and its working again

hot frigate
#

can you try if it's fixed on the master branch version

loud valley
#

I was installing pycord using pip install and then i obv get 2.7.0 release. I prob need to clone the git repo to try on the current main branch, right?

#

alr, i used: pip install git+https://github.com/Pycord-Development/pycord.git
and went to version: py-cord-2.7.1.dev12+g128a1727e Which appears to be the main branch and the issue persists

hot frigate
#

alright so it wasn't fixed yet
since I don't know anything about paginators I can't really help you but someone else will see this

loud valley
hot frigate
#

Most likely a pycord issue
If you want you can make a GitHub issue too

loud valley
#

Alr, will do. Ty

hot frigate
#

also can you show the full traceback?

loud valley
#
Traceback (most recent call last):
  File "...site-packages\discord\commands\core.py", line 138, in wrapped
    ret = await coro(arg)
          ^^^^^^^^^^^^^^^
  File "...site-packages\discord\commands\core.py", line 1108, in _invoke
    await self.callback(ctx, **kwargs)
  File "{botLocation}main.py", line 140, in test
    await commands.test(ctx, arg)
  File "{botLocation}features\commands.py", line 18, in test
    await Paginator(pages=[PageGroup(pages=["hi", "hit", "wah"], label="thing"), PageGroup(pages=["fi", "fit", "fah"], label="thinfdg")], show_menu=True).respond(ctx.interaction)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "...site-packages\discord\ext\pages\pagination.py", line 455, in __init__
    self.add_menu()
  File "...site-packages\discord\ext\pages\pagination.py", line 752, in add_menu
    self.menu = PaginatorMenu(self.page_groups, placeholder=self.menu_placeholder)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "...site-packages\discord\ext\pages\pagination.py", line 1274, in __init__
    opts = [
           ^
  File "...site-packages\discord\ext\pages\pagination.py", line 1276, in <listcomp>
    label=page_group.label,
          ^^^^^^^^^^^^^^^^
AttributeError: 'Page' object has no attribute 'label'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "...site-packages\discord\bot.py", line 1154, in invoke_application_command
    await ctx.command.invoke(ctx)
  File "...site-packages\discord\commands\core.py", line 435, in invoke
    await injected(ctx)
  File "...site-packages\discord\commands\core.py", line 146, in wrapped
    raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'Page' object has no attribute 'label'
#

I took out the file locations, but the important part should remain

proud atlas
#

Maybe related to ur commit, I remember you doing some show menu thing

loud valley
proud atlas
#

i tjhink i find the issue

#

could you try something for me ?

loud valley
#

sure

proud atlas
#

edit the line
self.page_groups = self.pages if show_menu else None

to
self.page_groups = pages if show_menu else None

#

inside th paginator and tell me if it help

loud valley
#

yup, that fixed it

#

it works fine now, sends the Paginator and all buttons, select menus work as intended

proud atlas
#

thanks for ur help

loud valley
#

alr, ty for the help. Do you need me to do anything else?

late rock
proud atlas
# late rock What's the issue ?

self.page_groups = self.pages if show_menu else None
it was using the converted pages from the pages group instead of the page group