Previously a dict containing { "embeds": embeds } would have to be returned in format_page to send multiple embeds. This simplifies the usage by allowing the user to simply return the list of embeds.
Example:
class MultipleEmbeds(menus.ListPageSource):
def __init__(self, data):
super().__init__(data, per_page=3)
async def format_page(self, menu, entries):
embeds = []
for entry in entries:
embed = nextcord.Embed(title="Entries", description=entry)
embeds.append(embed)
return embeds
@bot.slash_command(guild_ids=[TESTING_GUILD_ID], name="beds")
async def button_multiple_embed_description(interaction):
data = [f"Description for entry #{num}" for num in range(1, 51)]
pages = menus.ButtonMenuPages(source=MultipleEmbeds(data))
await pages.start(interaction=interaction)
Resolves #29
Previously a dict containing
{ "embeds": embeds }
would have to be returned informat_page
to send multiple embeds. This simplifies the usage by allowing the user to simply return the list of embeds.Example: