简体   繁体   中英

Python and Telethon: how to handle sw distribution

I developed a program to interact between Telegram and other 3rd party Software. It's written in Python and I used the Telethon library.

Everything works fine, but since it uses my personal configuration including API ID, API hash, phone number and username, I would like to know how to handle all of this if I wanted to distribute the software to other people.

Of course they can't use my data, so should they login into Telegram development page and get all the info? Or, is there a more user-friendly way to do it?

Since the API ID and the API Hash in Telegram are supposed to be distributed with your client all you need to do is prompt the user for their Phone Number.

You could do this using a GUI Library (like PySide2 using QInputDialog ) or if it is a command line application using input() . Keep in mind that the user will also need a way to enter the code they receive from Telegram and their 2FA Password if set.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM