Skip to content

[BUG] Paginator extension throws on footer #1567

Open
@i0bs

Description

@i0bs

Library Version

5.10.0

Describe the Bug

Using Paginator from the interactions.ext.paginators extension will throw a TypeError for missing embed footers.

From @algorythm_cs on Discord:

  File "...\interactions\ext\paginators.py", line 346, in to_dict
    page.set_footer(f"Page {self.page_index+1}/{len(self.pages)}")
TypeError: Embed.set_footer() takes 1 positional argument but 2 were given

After checking the extension and Embed code, I've flagged the bug as failing to rewrite our embed, due to the method's return:

def set_footer(self, text: str, icon_url: Optional[str] = None) -> "Embed":
"""
Set the footer field of the embed.
Args:
text: The text to go in the title section
icon_url: A url of an image to use as the icon
"""
self.footer = EmbedFooter(text=text, icon_url=icon_url)
return self

This is neglected when converting embeds to dictionaries within the paginator:

if not page.footer:
page.set_footer(f"Page {self.page_index+1}/{len(self.pages)}")

Steps to Reproduce

  1. Create a variable containing an Embed omitting footer.
  2. Create a variable declaring a Paginator, whether from one embed, or numerous.
  3. Attempt to use .send() on the paginator.

Expected Results

A paginator should be sent without any bugs (assuming a pragmatic approach)

Minimal Reproducible Code

client = Client(...)
embeds = [Embed(title="foo")]

@slash_command()
async def replicate_bug(ctx):
    paginator = Paginator.create_from_embeds(client, *embeds)
    await paginator.send()
    await ctx.send("bar")

Traceback

No response

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.
  • I have attempted to debug this myself, and I believe this issue is with the library

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is neededspecific conditionThis happens on specific condition

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions