@commands.command()
@commands.guild_only()
@commands.has_permissions(kick_members=True)
async def kick(self, ctx, user: discord.Member, *, reason: str=None):
    'Kicks a user from the server.'
    if (user == ctx.author):
        return (await ctx.send('Kicking yourself? smh.'))
    if (user == self.bot.user):
        return (await ctx.send("I can't kick myself."))
    res = (f', for reason: `{reason}`' if reason else '')
    try:
        (await user.kick(reason=reason))
        (await ctx.send(f'Kicked {user}{res}'))
    except discord.Forbidden:
        (await ctx.send("I don't have permissions to kick that user."))
    except Exception as e:
        raise e
Kicks a user from the server.
@commands.command()
@commands.guild_only()
@commands.has_permissions(kick_members=True)
async def kick(self, ctx, user: discord.Member, *, reason: str=None):
    
    if (user == ctx.author):
        return (await ctx.send('Kicking yourself? smh.'))
    if (user == self.bot.user):
        return (await ctx.send("I can't kick myself."))
    res = (f', for reason: `{reason}`' if reason else )
    try:
        (await user.kick(reason=reason))
        (await ctx.send(f'Kicked {user}{res}'))
    except discord.Forbidden:
        (await ctx.send("I don't have permissions to kick that user."))
    except Exception as e:
        raise e