Importing the Telegram contacts into the phone book - Android I have a fairly serious problem. I lost all the numbers in the phone book, breaking the SIM card, but luckily I saw that most of them are stored on telegram. I tried with telegram desktop to export all contacts and the operation was successful. Now, how can I put them in the phone book? I hope there is a solution, even starting a new procedure from scratch. 

Solution here does not work Sync Telegram Contact with Phone Contact
After exporting all the contacts with Export Telegram data, I created a Python script that extracted all the contacts from the generated website. 
The script, positioned directly inside the Telegram Desktop folder, is the following:

#FIRST FOLDER TO CHANGE
pathToFile = 'DataExport_08_12_2018 (2)/lists/contacts.html'

with open(pathToFile, encoding='utf-8') as f:
    lines = tuple(l for l in f.readlines())
    with open('csvToConvert.csv', "w", encoding="utf-8") as outputFile:
        outputFile.write('nome, telefono\n')
        for i,l in enumerate(lines):
            if l.startswith('    &lt;div class="name bold"&gt;') and lines[i+4].startswith('    &lt;div class="details_entry details"&gt;'):
                tel = lines[i+5].replace(' ','')
                if not tel.startswith('+39'):
                    if "+" in tel and tel[1] == '3':
                        outputFile.write(lines[i+1].replace('\n','') + ', ' + tel.replace('+', '+39'))
                    else:
                        if tel[0] == '0':
                            outputFile.write(lines[i+1].replace('\n','') + ', ' + tel)
                elif tel.startswith('0039'):
                    outputFile.write(lines[i+1].replace('\n','') + ', ' + tel)
                else:
                    outputFile.write(lines[i+1].replace('\n','') + ', ' + tel)


Note that this script is aimed to the Italian telephone numbers (note the prefixes that are checked in some if clauses)!
However, once the folder is modified and the script is executed, a file called csvToConvert.csv is generated. 
Subsequently, this file must be passed to a program called CVS to VCard, which takes care of converting the csv file into a vcard file. 
Then, once the vcard file is generated, just enter it on google contacts (https://contacts.google.com/ > more > import), and you're done! Magically you will find all the contacts in the phone book of your android phone!
I hope I have been helpful.