How to get user id from nickname in discord.py?

Solution for How to get user id from nickname in discord.py?
is Given Below:

I’m writing a discord bot for my discord-server and the people on the server change their nicknames like their underwear. Can i get the user id from their changing nicknames?

I want to code a command like this:

!command @mention

I need the user id of the mention. Thanks in advance!

Hope this helps 🙂

@client.command()
async def id(ctx, member: discord.Member = None):
    if not member:
        await ctx.send('Please mention a user')
    else:
        await ctx.send(member.id)