F
F
ferrson2020-08-01 16:50:23
Python
ferrson, 2020-08-01 16:50:23

Why does Message.reactions return an empty array?

Recently I ran into a problem that although there are reactions on the message, Message.reactions produces an empty array.
5f2571857ce61550376288.jpeg
What returns.
The code:

@bot.command(pass_context=True)                            
@commands.has_permissions(administrator=True)
async def vari(ctx, name, time, *vars):
    stime = time.split("|")
    string = '0.x'                                             
    try:
        mtime = stime[1]
    except IndexError: 
        await ctx.send('введи команду корректно!')
    counter = 0
    dstrings =[]
    for i in vars:                                                 
        counter += 1
        string = f'{counter}.{i}'
        dstrings.append(string)                                
    desc= '\n'.join(dstrings)
    emb = discord.Embed(title=f'Опрос: {name}',
                        description=desc,                                          
                        colour=discord.Color.purple())
    mess = await ctx.send(embed=emb)                           
    for i in range(1, len(vars)+1):
         await mess.add_reaction(emjs[str(i)]) #emjs список с реакциями
    if stime[1] == 's':
        await asyncio.sleep(int(stime[0]))
        await ctx.send(f"Опрос {name}  был завершен! Данные: ")
        await ctx.send(mess.reactions)
    elif stime[1] == 'min':
        await asyncio.sleep(stime[0] * 60)
        await ctx.send("Опрос {name} был завершен! Данные: "

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2020-08-01
@Proffs

So you don’t update your mess
variable Reactions added, but mess still refers to the old version

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question