So the following code has an issue that I haven't been able to solve.
The bot sends a second "testMessasge" and puts the reaction on that message as well as the main message. The issue here is I can react to either message to trigger the code when I ONLY want a reaction to the first message to be considered.
Would appreciate any help.
async def foo(ctx, booleanValue, randomClass, stringValue='', otherData=None):
files, embed = createEmbed(ctx, randomClass)
message = await ctx.send(files=files, embed=embed)
await message.add_reaction(data.getEmoji('1'))
testMessage = await ctx.send('TEST')
await testMessage.add_reaction(data.getEmoji('1'))
def check(reaction, user):
return (user == ctx.message.author and str(reaction.emoji) == data.getEmoji('1'))
async def waitForEmoji(ctx, isBattle):
print(ctx.message.author)
try:
reaction, user = await bot.wait_for('reaction_add', timeout=300.0, check=check)
except asyncio.TimeoutError:
await ctx.send(ctx.message.author.display_name + 's connection closed.')
else:
print(user)
print(ctx.message.author)