When a member joins my server, my Bot sends a DM of the rules and then waits for their reaction to the message. The problem I'm having is when multiple members join, the Bot stops listening to the previous member. I'm not sure if this is normal behavior for the 'wait_for' function or If my code is incorrect. Any insight would be much appreciated
@bot.event
async def on_member_join(member):
guild = member.guild
greeting = await member.send(f'''Greetings {member.mention} \n
Welcome to **{member.guild}** \n
**Da Rules**
1. Be respectful
**Do you accept Da Rules?**''')
await greeting.add_reaction("✅")
await greeting.add_reaction("❌")
def check1(reaction, user):
if not user.bot:
return str(reaction.emoji) == '✅' or str(reaction.emoji) == '❌'
try:
reaction, user = await bot.wait_for('reaction_add', check=check1, timeout=300)
except:
mem = await guild.fetch_member(user.id)
await mem.send("**You've been kicked for idling too long**")
await mem.kick()
else:
mem = await guild.fetch_member(user.id)
if str(reaction.emoji) == '❌':
await mem.kick()
else:
await mem.send('Welcome')