Rapptz / discord-ext-menus

MIT License
234 stars 87 forks source link

Unresolved attribute reference 'embed' for class 'MenuPages' #26

Closed CnyAnime closed 3 years ago

CnyAnime commented 3 years ago

image. How can I fix that?

 async def format_page(self, menu: menus.MenuPages, entries):
        pages = []
        for index, entry in enumerate(entries, start=menu.current_page * self.per_page):
            pages.append(f"{index + 1}. {entry}")

        maximum = self.get_max_pages()
        if maximum > 1:
            footer = f"Page {menu.current_page + 1}/{maximum} ({len(self.entries)} entries)"
            menu.embed.set_footer(text=footer)

        if self.initial_page and self.is_paginating():
            pages.append("")
            pages.append("Confused? React with \N{INFORMATION SOURCE} for more info.")
            self.initial_page = False

        menu.embed.description = "\n".join(pages)
        return menu.embed
Rapptz commented 3 years ago

https://github.com/Rapptz/discord-ext-menus/issues/18

CnyAnime commented 3 years ago

@Rapptz wait the same for menu?

Rapptz commented 3 years ago

Linter errors are just errors with your linter. It's up to you to fix them. In this case your type hint needs to match the actual class, not the abstract one you inherit.

CnyAnime commented 3 years ago

I see. Thank you for your answer