async def _signupPost(ctx:interactions.SlashContext):
author_name = ctx.author.username
signup_embed = signupEmbed(author_name)
embed=signup_embed.embed_create()
await ctx.send(embed=embed, components=button)
@client.event
async def on_button_click(interaction):
if interaction.custom_id == "sign_up":
print('button clicked')
await interaction.defer_update()
await prompt_user(interaction.message,interaction)
async def prompt_user(ctx, interaction):
await ctx.send("Please type your tag and press enter. This msg automatically disapperas", delete_after=10)
def check(message):
return message.author == ctx.author and message.channel == ctx.channel
response = await client.wait_for('message', check=check, timeout=60)```
#Button callback
1 messages · Page 1 of 1 (latest)
Hey! Once your issue is solved, press the button below to close this thread!
where did you get this code?
Wrote it myself. I wrote using discord.py initially, changed it to interaction a couple hours ago
interactions.py provides support for making and responding to components, like buttons and select menus. Check out the component guide for more information.