A
A
Artem Imaev2022-03-06 02:25:29
Python
Artem Imaev, 2022-03-06 02:25:29

How to send the first message to a user in the TG by his nickname?

How to send the first message to a user in the TG by his nickname? That is, when launched, the bot would itself start sending a message to the user by his nickname (can the ID be pulled out and then by it?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
InternetMaster, 2022-03-07
@AIRC24

If the bot - then no way. Even if the user writes first, then by nickname - no way, only by ID. True, from December 7, 2021 ( from version 5.5 ) the bot can be the first to write:

Bots are now allowed to contact users who have submitted a request to join a chat where the bot is an administrator with can_invite_users admin rights, even if the user has never interacted with the bot before.

If at all you need to write first (not a bot), then this is the MTProto API.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question