Answer the question
In order to leave comments, you need to log in
The reaction works 1 time, why?
I’m making a bot to support, by reaction the bot creates a channel, but it does it 1 time, after another user clicks on the reaction, nothing happens, here is the code itself:
await message_support.add_reaction("✅")
time.sleep(5)
while True:
reaction, user = await client.wait_for("reaction_add")
if str(reaction.emoji) == "✅":
if user.id == 872913914013319188:
return
else:
channel_help = await guild.create_text_channel(f"help {user}", overwrites=None, category=category, reason=None)
await channel_help.set_permissions(ctx.guild.default_role, send_messages=False, read_messages=False, view_channel=False)
await channel_help.set_permissions(user, send_messages=True, read_messages=True, view_channel=True)
await channel_help.send(embed = discord.Embed(
title="Опишите свою проблему!",
colour=discord.Colour.form_rgb(255, 0, 0)
))
return
else:
if user.id == 872913914013319188:
return
else:
return
Answer the question
In order to leave comments, you need to log in
time.sleep
in asynchronous code .while True
can also block asynchronous code unless the loop contains asynchronous calls.Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question