telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
26.14k stars 5.18k forks source link

Telegram desktop numbers import #5455

Closed kasra-st closed 5 years ago

kasra-st commented 5 years ago

hi guys ; i'm going to do something on telegram desktop to add lots of numbers to my telegram contacts for advertisement purposes ; there is no way to add contacts to telegram from vcard so i need to change the main code of telegram; i know the code but i can't use it in visual studio or .cpp files because i really can't understand the original code so i can't figure out where to edit and replace my code. I would be really appriciate if anyone can tell me the right code and where to use the code in main source codes thank you all and thanks github. and also the main code is available in in this adress : https://github.com/telegramdesktop/tdesktop Telegram->Source Files->Boxes->add_contact_box.cpp /////////////////////////////////////////////////////////////////////////////// this is my code (c++) : ...... ....... int x=50 ; //50 is an example for starting number while (x<=1000) //1000 is an example for ending number { x++ ; bool(x) ; //for check if account exist or not } } ....... ....... bool(int x) { if (x exist) return contact ; else continue; }

RememberTheAir commented 5 years ago

You may want to use an higher level language like Python and PHP to interact with the API, instead of editing tdesktop's code just to import a bunch of contacts, as tdesktop was not designed to be a scriptable MTProto client. Have a look at Pyrogram/Telethon (python) or MadelineProto (PHP). Or any TDLib json interface out there, there's one in pretty much every language

kasra-st commented 5 years ago

You know actually i know c++ and html and ... so I don't know php yet ! and i understood the source is written on c++ so do you know the scriptable version of telegram for c++ ? or can you tell me where to add the php code and convert my code to php for me ?

RememberTheAir commented 5 years ago

You can use TDLib (C++ examples here)

kasra-st commented 5 years ago

can you take a look at this file and give me a better direction ? line 106 add_contact_box.zip

kasra-st commented 5 years ago

hi again ; I'm trying to do it with javascript instead of editing whole desktop application so can you tell me telegram web API to Use in javascript and maybe an article for how to use API in JavaScript thank you so much

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.