@commands.Cog.listener()
async def on_member_join(self, member):
test = randint(1000, 99999)
def check(m):
return m.content == f'{captcha}' and m.author.id == member.id
try:
msg = await self.client.wait_for('message', timeout=30.0, check=check)
await msg.add_reaction("✅")
except asyncio.TimeoutError:
await msg.add_reaction("❌")
await member.send('TimeOut')
await member.kick(reason='TimeOut')
else:
await member.send('Thank')
Ошибка:
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "D:\Py\lib\site-packages\discord\client.py", line 312, in _run_event await coro(*args, **kwargs) File "c:\Users\Stanisla\Desktop\Turtle-Bot\cogs\Moderation.py", line 135, in on_member_join await msg.add_reaction("❌") UnboundLocalError: local variable 'msg' referenced before assignment