T
T
TanderOFF2021-06-26 12:53:31
Python
TanderOFF, 2021-06-26 12:53:31

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

1 answer(s)
V
Vadim Ushakov, 2021-08-24
@Nightmare1

await responce .edit_origin()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question