discord-ext-menus icon indicating copy to clipboard operation
discord-ext-menus copied to clipboard

Menus wont load unless I explicitly ask for the page first

Open TurnrDev opened this issue 4 years ago • 3 comments

This is my code:

        embeds = LeaderboardPages(leaderboard, per_page=10, base=emb, emoji=self.emoji, stat=stat)

        menu = menus.MenuPages(
            source=embeds, timeout=300.0, message=message, clear_reactions_after=True,
        )
        await menu.show_page(0)
        await menu.start(ctx)

I followed the code example in README.md for AsyncIteratorPageSource and it says to simply call the Menu Pages object and the await menu.start(ctx) but any time I did that I had an empty response. Seems I needed to call await menu.show_page(0) first

TurnrDev avatar Aug 18 '20 23:08 TurnrDev

After thurther investgation, the issue only seems to happen when message has been declared on the init for MenuPages.

TurnrDev avatar Aug 18 '20 23:08 TurnrDev

Unfortunately this one is a bit rough to fix. Per the implementation as it stands, send_initial_message isn't called if a message is already supplied. For Menu that works okay but for MenuPages that means that it's never called and thus the page isn't shown.

Rapptz avatar Aug 18 '20 23:08 Rapptz

I've added a note in README about this exact issue (PR #17) - It's not a bug fix but it's better than nothing :)

TurnrDev avatar Aug 19 '20 00:08 TurnrDev