Когда ввожу команду, бот кидает прописанное сообщение, но не кикает пользователей, и в консоль выдает это
Ignoring exception in command kickrole:
Traceback (most recent call last):
File "C:\Users\user_German\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\user_German\Desktop\bot python\discord-bot.py", line 32, in kickrole
await member.kick()
File "C:\Users\user_German\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\discord\member.py", line 568, in kick
await self.guild.kick(self, reason=reason)
File "C:\Users\user_German\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\discord\guild.py", line 1997, in kick
await self._state.http.kick(user.id, self.id, reason=reason)
File "C:\Users\user_German\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\discord\http.py", line 248, in request
raise Forbidden(r, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\user_German\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\user_German\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\user_German\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\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: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
Вот сам код:
@bot.command(pass_context = True)
@has_permissions(manage_roles=True, ban_members=True, kick_members=True)
async def kickrole(ctx, rolename:discord.Role):
for member in ctx.guild.members:
rolename = discord.utils.get(ctx.guild.roles)
if rolename in member.roles:
await ctx.send("Почищено")
await member.kick()
P.S. У бота выданы права администратора, его роль выше той, что нужно кикнуть.
Так же бот нормально кикает обычно командой на кик конткретного участника