Hello, I'm trying to learn discord components v2 in pycord but I don't know how to put buttons in the cointainer next to a text or other.
I try to make a container (on the first pic)
Here my code :
from io import BytesIO
from discord import (
ApplicationContext,
Bot,
SeparatorSpacingSize,
User,
)
from discord.ui import (
Container,
Separator,
TextDisplay,
View,
)
class MyView(View):
def __init__(self):
super().__init__(timeout=None)
text1 = TextDisplay("## Welcome to 7 Exchange.")
text2 = TextDisplay(
"7 Exchange offers a secure and trusted platform for converting your fiat currency into cryptocurrency—ensuring competitive rates and top-tier security every step of the way."
)
text3 = TextDisplay("Before getting started, please take a moment to review our Terms of Service and Fee rates.")
container = Container(
text1,text2,text3,
color=0x1567E1,
)
container.add_item(Separator(spacing=SeparatorSpacingSize.small))
container.add_text("- Ready to begin your exchange? Simply click the button below to open a support ticket.")
container.add_text("- Our system is designed as a secure intermediary—our dedicated team oversees every transaction to ensure a seamless and reliable experience.")
self.add_item(container)
bot = Bot()
@bot.command()
async def show_view(ctx: ApplicationContext):
"""Display a sample View showcasing various new components."""
await ctx.respond(view=MyView())
bot.run("----------------")