'How can I get message ID in telegram which can be used in t.me URLs in TdApi?

I'm using TdAPi and I want to get the message Id, which combined with the Username gives you the full link, e.g. something like this.

The message id I get right now is something like 161381342160 but I need to get 22.

I'm listening for UpdateNewMessage right now - do I need to check something else?

Please note: this is not a bot, it's a Telegram client program.

Webogram successfully does this but I haven't figured out how it accomplishes that task.

Thank you!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source