Answer the question
In order to leave comments, you need to log in
How not to send a response to discord?
Good day .
Discord buttons have just been released. I'm trying to make them, but I would like to refuse to respond to the button click.
If the event is successful. Then the bot should send the response back if without success. It shows "Interaction Error".
It is necessary that when you click, the ambience changes and there is nothing else. It is possible to do this. But I don't quite understand.
The code:
msg = await ctx.send(embed = discord.Embed(title = ' Личный питомец', timestamp = ctx.message.created_at,description=f'{ctx.author.display_name} вы уверенный что хотите отпустить своего питомца'),components = [Button(style = ButtonStyle.green, label = 'Да'),Button(style = ButtonStyle.red, label = 'Нет')])
responce = await client.wait_for('button_click', check = lambda message: message.author == ctx.author)
if responce.component.label == 'Да':
await responce.respond(content = 'вы успешно отпустили питомца')
return
else:
emb = discord.Embed(title=f' Личный питомец', description=f'> {ctx.author.mention} хорошо!', color=0xafffbe)
await msg.edit(embed=emb)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question