It uses the google API to get upcoming events on a calendar but I have to limit the number of events it gets since the message will be too long. The list of calendars is stored in the description of the embed. Is there any way to limit the embed to a certain size and be able to scroll down in the description so all events can be displayed?
Asked
Active
Viewed 883 times
1
-
There's no scrollbar feature for embeds but I guess you can use emojis in order to create multiple embed pages. You can check out [this](https://stackoverflow.com/a/61793587/13892965) answer. – Nurqm Jan 12 '21 at 14:06
2 Answers
0
As Zimano said, you can't have scrollable elements in embeds, but what you can do is a multi-page embed, the easiest approach would be with ext.menus
(To install it: python -m pip install -U git+https://github.com/Rapptz/discord-ext-menus
)
import discord
from discord.ext import menus
class MultiPageEmbed(menus.ListPageSource):
async def format_page(self, menu, entry):
return entry
@bot.command()
async def whatever(ctx):
# Put all your embeds here
embeds = [discord.Embed(title="Embed 1"), discord.Embed(title="Embed 2"), discord.Embed(title="Embed 3")]
menu = menus.MenuPages(MultiPageEmbed(embeds, per_page=1))
await menu.start(ctx)
Unfornatelly it's still in beta so there's no docs about it.

Łukasz Kwieciński
- 14,992
- 4
- 21
- 39
-
Here is my current code how would I adjust? ```client.event async def on_message(message): if message.author == client.user: return if msg.startswith('$events'): events = event() poggers=discord.Embed(title="Events", url="https://calendar.google.com/calendar/u/3?cid=Y180OXZpYmEycWpjZzE5dHIydmYyM21hOWJpNEBncm91cC5jYWxlbmRhci5nb29nbGUuY29t", description=events, color=0x00ffff) poggers.set_footer(text="Events Calendar") await message.channel.send(embed=poggers)``` – Joshua Siraj Jan 12 '21 at 16:43
-
Sorry if i looks confusing I cant seem to figure out proper format in comments – Joshua Siraj Jan 12 '21 at 16:47
-
But I think you can figure out how to make it work, good luck! – Łukasz Kwieciński Jan 12 '21 at 17:15