Is there a way for a discord bot to respond to a mention of a specific user using Discord.py?

I would like my bot to be able to reply to a mention of a specific user (ex.. one person mentions my personal account and the bot responds saying that I’m currently not here)

Is there a way to do this using a format similar to this?

@client.event
async def on_message(message):

    if message.author == client.user:
        return

    if message.content.startswith('@user_id'):
        await message.channel.send('Im not here leave a message!') 

Answer

You would need to use the specific format that discord bots receive mentions. The format is <@!user_id>.

@client.event
async def on_message(message):
    if ("<@!put user id here>" in message.content):
        await message.channel.send("Im not here leave a message!")

Example for how applied this and it worked for me

@client.event
async def on_message(message):
    if ("<@!348256959671173120>" in message.content):
        await message.channel.send("Im not here leave a message!")