Answer the question
In order to leave comments, you need to log in
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.
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question