I'm trying to make Discord bot command, where Bot creates Emoji and if user reacts on this Emoji - bot doing some required stuff, but getting this error on check part:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: check() takes 1 positional argument but 2 were given
The Bot sends the message and attaches Emoji to it, but however, the check part throws an error and I donβt know how to solve it.
Here's my code:
An error is issued in the penultimate line of code
@commands.command()
async def test(self, ctx):
author = ctx.author
message = await ctx.send('test')
emote = 'β'
for e in emote:
await message.add_reaction(e)
def check(author):
def react_check(reaction, emoji):
return message.author == author and reaction.message.id==msg.id and reaction.emoji==emoji
return check
await self.client.wait_for('reaction_add', check=check(author, emote), timeout=60)
await ctx.send('some stuff after check')
checkonly acceptsauthorargument as input but you are passing inauthorandemote- sshashank124await self.client.wait_for('reaction_add', check=check, timeout=60)this error is occure, but i pass only 1 argument in this case? - Clonexy700=check. Do you get exactly the same error or little different ? - furasawait self.client.wait_for('reaction_add', check=lambda reaction, user: reaction.emoji == 'β', timeout=60)but if i use this, Discord Bot not waiting for user reaction and sending message after check immediately - Clonexy700