The command is not kicking the member

Viewed 127

I added a kick command with none reason for kicks but the bot cannot kick a member, but the permissions are working well. what is the problem with this code?

@client.command()
@commands.guild_only()
@commands.has_permissions(kick_members=True)
async def kick(self, ctx, member: discord.Member, *, reason=None):
    await member.kick(reason=reason)
    await ctx.send(f'User {member} has been kick')
2 Answers
await member.kick(reason=reason)

Change this line to

await client.kick(member)
Related