Its my first time using buttons in discord.py
I want the embed to delete itself when someone clicks the delete button. This is my code but there are some problems.
Anyone can delete the message by clicking the button. I only want the user who ran the command to interact with the button.
When I click delete button, it automatically deletes all messages which were previously sent by the bot.
msg = await ctx.channel.send(embed=embed,components = [Button(label = "Delete", style=ButtonStyle.red)])
interaction = await bot.wait_for("button_click")
if interaction.component.label.startswith("Delete"):
await msg.delete()