dimanche 4 avril 2021

bot not reading the second reaction when the user reacts multiple emojis to the same message.. Discord.py

the bot not reading the second if statement when the user reacts 1️⃣ to a message first and react to 2️⃣ to the same message second...i used the code from someone who helped me here before but I'm gettin the same result.. the code is:

def sequence(seq):
  if seq is None:
    return()
  if isinstance(seq,Sequence) and not isinstance(seq, str):
    return seq
  else:
    return(seq,)
    
def reaction_check(message=None,emoji=None, author=None, ignore_bot=True):
  message = sequence(message)
  message = tuple(m.id for m in message)
  emoji = sequence(emoji)
  author = sequence(author)

  def check(reaction, user):
    if ignore_bot and user.bot:
      return False
    if message and reaction.message.id not in message:
      return False
    if emoji and reaction.emoji not in emoji:
      return False
    if author and user not in author:
      return False
    return True
  return check

  check = reaction_check(message=userrreact, author=members.users[members.leader].user, emoji=("1️⃣", "2️⃣", "3️⃣","4️⃣","5️⃣","6️⃣","7️⃣","8️⃣","9️⃣","🔟"))

  reaction, user = await
client.wait_for("reaction_add", check=check)

  if len(members.users) == 2:
    await asyncio.sleep(7)
    if reaction.emoji == "1️⃣":
      print("first check")
    if reaction.emoji == "2️⃣":
      print("second check")

Aucun commentaire:

Enregistrer un commentaire