I use node.js module for Telegram bot.
I’m trying to get the user’s contact on telegram using telegram API.
Telegram API has 2 types: Bot API and Telegram API.
I think Bot API can not get the user’s contacts.
In Telegram API there is the method contact.getContacts
. But I don’t know how to use it.
How can I get the contacts on Telegram?
2
Answers
Bot API can get contact info too; I think it is easier in this case.
You can try reply keyboard with request_contact. If the user clicks it, you will receive message update with Contact field.
this code will give you the contact, user shares his/her contact with your bot , user types command ‘/special’ will be prompted with button to allow bot to get contact and on agreeing in your node server you may log contact info remember to declare Markup —->