Answer the question
In order to leave comments, you need to log in
exceptions not working?
@pybot.command()
async def to(ctx, member: discord.Member):
emojis = ['✅', '❌']
load = discord.Embed(title='', description = f"")
load.set_author(name= pybot.user.name, icon_url= pybot.user.avatar_url)
load.set_footer(text= f"✅ - принять запрос, ❌ - отклонить запрос.")
message = await ctx.send(embed = load)
for emoji in emojis:
await message.add_reaction(emoji)
try:
def check(reaction, user):
if user.bot is False and user.id == member.id:
return (user and str(reaction.emoji) == '✅') or (user and str(reaction.emoji) == '❌')
elif user.bot is True:
pass
reaction, user = await pybot.wait_for('reaction_add', timeout= 1, check=check)
await message.clear_reactions()
except asyncio.TimeoutError:
await message.edit("Время истекло")
else:
if reaction.emoji == '✅':
load = discord.Embed(title='', description = f"")
load.set_author(name= pybot.user.name, icon_url= pybot.user.avatar_url)
load.set_footer(text= f"")
load.set_image(url = f"")
await message.edit(embed = load)
elif reaction.emoji == '❌':
load = discord.Embed(title='', description = f"")
load.set_author(name= pybot.user.name, icon_url= pybot.user.avatar_url)
load.set_footer(text= f"")
await message.edit(embed = load)
pass
else:
pass
except asyncio.TimeoutError:
await message.edit("Время истекло")
reaction, user = await pybot.wait_for('reaction_add', timeout= 1, check=check)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question