E
E
elena81kachanova2019-12-01 16:22:36
API
elena81kachanova, 2019-12-01 16:22:36

How to make a link to a user who does not have a username?

Good day.
I'm testing core telegram api (not to be confused with bot api).
Made a parsing of the group.
As a result, I get information about all users of the group.
I need to get a link like @kirillvorontsov555, through which you can get to the user and write him a message.
But not all users have username filled in, which is written with a dog in the beginning: @kirillvorontsov555
I only know the user id.
Question: How to make a link to a user who does not have a username, but his id is known?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
bkosun, 2019-12-01
@elena81kachanova

No, this limitation is due to Telegram's privacy policy and abuse prevention.
You can mention the user when sending messages (BOT API), but this is not what you need:

Links tg://user?id= can be used to mention a user by their id without using a username. Please note:
These links will work only if they are used inside an inline link. For example, they will not work, when used in an inline keyboard button or in a message text.
These mentions are only guaranteed to work if the user has contacted the bot in the past, has sent a callback query to the bot via inline button or is a member in the group where he was mentioned.

https://core.telegram.org/bots/api#markdown-style

N
Ninazu, 2019-12-01
@Ninazu

<a href="tg://user?id=123456789">parseMode=HTML</a>

T
Ternick, 2019-12-01
@Ternick

I think that, in principle, it is impossible to do absolutely nothing :)
This thing also bothers me.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question