I made a kick command for my discord bot (hosted on repl.it). I enabled all of the intents and the bot has admin privileges, but still it raises an error Code:
intents = discord.Intents.all()
bot = Bot("$",help_command=None,intents=intents)
@bot.command()
async def k(ctx,member:discord.Member):
await member.kick()
Error as text:
Ignoring exception in command k:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "main.py", line 91, in k
await member.kick()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/member.py", line 568, in kick
await self.guild.kick(self, reason=reason)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/guild.py", line 1997, in kick
await self._state.http.kick(user.id, self.id, reason=reason)
File "/opt/virtualenvs/python3/lib/python3.8/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 "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/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

the error image
I made a totally new bot and made the same kick command but it still raises an exeption!