Replies: 1 comment
-
Hi there, this code seems to mix discord.py code with code from unsupported third-party libraries. To send buttons alongside other message content you will want to create a view instead and create the button inside of it: class MyView(discord.ui.View):
@discord.ui.button(label='label1', style=discord.ButtonStyle.red)
async def on_button_click(self, interaction: discord.Interaction, button: discord.ui.Button) -> None:
await interaction.response.edit_message(content='Button clicked!', view=None) You can then send this view alongside any message if you'd like to: embed = discord.Embed(description='Hello, World!')
await channel.send(embed=embed, view=MyView()) Since you're using There is also a new section in the docs on the Bot UI Kit and quite a few other view examples that might be helpful to you. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I need to send the embed with button but idk how to do this
Beta Was this translation helpful? Give feedback.
All reactions