I’m building a Telegram bot and need help with generating profile links for users who send messages. I can retrieve basic user information when processing incoming messages, but I’m stuck on how to convert this data into an actual clickable profile link.
Here’s what I’m working with:
@Override
public void handleIncomingMessage(Update msgUpdate) {
User sender = msgUpdate.getMessage().getFrom();
// Available data: sender.getFirstName(), sender.getLastName()
// Also have: sender.getId() which returns a numeric value
// Question: How do I turn this numeric ID into a working Telegram profile URL?
}
I can access the sender’s name and user ID, but I’m not sure about the correct way to format these into a proper Telegram profile link. What’s the right approach here?