discord-ext-menus
discord-ext-menus copied to clipboard
Menus wont load unless I explicitly ask for the page first
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
After thurther investgation, the issue only seems to happen when message has been declared on the init for MenuPages.
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.
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 :)