W
W
Wolf_Yout2021-10-26 15:01:47
Python
Wolf_Yout, 2021-10-26 15:01:47

How to make the issuance of roles using reactions?

I tried like this:

@bot.command(name='new_task')
async def _task(ctx):
    embed = discord.Embed(title='Цвета :tada:')
    live = await ctx.send(embed = embed)
    await live.add_reaction('')
    await live.add_reaction('')
    await live.add_reaction('')

@bot.event
async def on_raw_reaction_add(ctx):
    if ctx == '':
        await ctx.author.add_roles(902525047019810847)
    if ctx == '':
        await ctx.author.add_roles(902525088845418517)
    if ctx == '':
        await ctx.author.add_roles(902525124685758494)

But nothing works, but as I understand it, I can’t figure out how to get the reaction that was clicked

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2021-10-26
@Wolf_Yout

Read the examples in the documentation, eh? There it is .
There you need to check not ctx, but ctx.emoji.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question