#Bot wait_for doesn't work

1 messages · Page 1 of 1 (latest)

sweet raven
#

Why when i press button, my bot regardless of adding reactions on message printing "Timeout!" ?
how i can do a wait_for on reaction add ?

@bot.listen()
async def on_interaction(interaction):
  if interaction.custom_id == 'balance':
    msg = await interaction.user.send("Hola!")
    await msg.add_reaction('🥳')
    try:
      await bot.wait_for("reaction_add", timeout=10.0, check=lambda user: user == interaction.user)
      print('Hola!')
      await msg.delete()
    except asyncio.TimeoutError:
      print('Timeout!')
      await msg.delete()
golden oyster
#

wait_for("reaction_add")

sweet raven
#

but it's doesn't work with my code..

golden oyster
#

?tag idw

left roostBOT
#

Saying it doesn't work or asking what's wrong with this code? is not helpful for yourself or others.
Describe what you expect and/or tried (with your code), and what isn't going right.
Please provide any errors you get for optimal assistance.

golden oyster
#

@sweet raven you got intents?

elfin acorn
#

Pretty sure the check gets 2 arguments, reaction and message