class Menu(discord.ui.View):
def __init__(self, ctx):
super().__init__(timeout=180) # 2 dakika timeout ekledim istersen silebilirsin
self.value = None
self.ctx = ctx
@discord.ui.button(label="Send Message", style=discord.ButtonStyle.grey)
async def menu1(self, button: discord.ui.Button, interaction: discord.Interaction):
await self.ctx.send("Hello you clicked me")
# timeout
async def on_timeout(self):
for child in self.children:
child.disabled = True # bütün butonları kapatıyor
@Bot.command()
async def embed_with_buttons(ctx):
embed = discord.Embed(colour=0xFF5733, title="Title", type="rich", url=None, description="description", timestamp=None)
await ctx.send(embed=embed, view=Menu(ctx))