I Have a problem in using Telegram APIs in C#.
I want to create a contact in telegram with a specific phone number so i can send messages directly to a phone number that was not in my contacts.
How can i create a contact with specific phone number in telegram with c#?
I tried to use TLSharp to do this but i did not found any method.
4
Answers
There is nothing for it in Telegram Bot API: https://core.telegram.org/bots/api
TLSharp now has method ImportContactsAsync, you can use it like this:
Wasted some hours trying to find how to do it in the internet, but hadn’t found, hope it will help someone with the same problem.
There is now WTelegramClient library, using the latest Telegram Client API protocol (connecting as a user, not bot).
The library is very complete but also very simple to use. Follow the README on GitHub for an easy introduction.
To create a contact by phone number and send a message to it, the whole Program.cs would be as simple as:
Right Code that works actually