W
W
webe2019-02-18 12:01:59
Node.js
webe, 2019-02-18 12:01:59

How to send a message to a user inside a chat?

How to send a message to a user inside the chat if the user does not have a login (username), i.e. @vasya cannot be contacted, he has only a First and Last Name.
It is necessary that this message work as a message addressed only to him, i. @vasya привет
Please tell me
https://github.com/yagop/node-telegram-bot-api

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael, 2019-02-18
@webe

This is done using the caption_entities field of the Message object .
caption_entitites is an optional field, an array of objects of the MessageEntity type, in which you can specify various additional information, including text_mention - just for cases when the user does not have @username . Instead, first_name and last_name are used (the second is optional).
Links to official documentation: MessageEntity , User

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question