Был дискорд бот на питоне, работал отлично, по неизвестной причине команда перестала работать и в консоль выводится куча ошибок из AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\
Почему появились ошибки, и как их устранить?
Ignoring exception in on_command_error
Traceback (most recent call last):
File "C:\Users\PAIN\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "d:\PythonWorks\DiscordAL\lol.py", line 29, in mute
await member.add_roles(muterole)
File "C:\Users\PAIN\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\member.py", line 676, in add_roles
await req(guild_id, user_id, role.id, reason=reason)
AttributeError: 'NoneType' object has no attribute 'id'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\PAIN\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "d:\PythonWorks\DiscordAL\lol.py", line 85, in on_command_error
raise error
File "C:\Users\PAIN\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 902, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\PAIN\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 864, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\PAIN\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'id'