How do I make my bot react to someone else’s message if they are mentioned?

Hello, I’ve been trying to make my bot react to someone else’s message if they are mentioned, but I can’t find my way around it. Can someone tell me the method on how to make this?