Answer the question
In order to leave comments, you need to log in
Is it possible to check the user in the Telegram API?
Read the list of methods. I can’t understand, is there a User object https://tlgrm.ru/docs/bots/api#user and are the available actions with it indicated somewhere?
In particular, it is of interest if the bot is sent a user's nickname of the form @nick
1. Can the bot turn to any method to find out if a user with such a nickname in the cart really exists now or was he sent incorrect information?
2. Is it possible to find out id by nickname and vice versa, find out nickname by id (if it is specified of course)
Answer the question
In order to leave comments, you need to log in
1. No, but if username is not specified, then you will find a full-fledged User object
. In such a message there will be an array of entities from MessageEntity objects . A text like @username will add a MessageEntity with type mention , and if username is not specified in the profile, then the type will be text_mention . Such a MessageEntity contains a User object with an id inside (which proves its existence)
2. It is possible only within the same chat (group, channel) and only username by id
, getChatMember method
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question