TLSharp Not allways imports Telegram contacts

154 views Asked by At

I'm using TLSharp to create a program that imports Telegram contacts.

The first tests with 3-4 numbers worked well. But now I'm trying to import 1000 contacts that I know they have Telegram installed and it doesnt' work well. I do it in groups of 100, and the first time it only imports 2 or 3, but after that, it allways returns 0.

Even if I try again (deleting those contacts) it doesn't imports those contacts previously imported.

This is how I import contacts:

            TLVector<TLInputPhoneContact> vectorInputPhoneContact = new TLVector<TLInputPhoneContact>();

            numbersToImport.ForEach(number =>
            {
                vectorInputPhoneContact.Add(new TLInputPhoneContact
                {
                    FirstName = number,
                    LastName = number,
                    Phone = number
                });
            });

            TLImportedContacts importedContacts = client.SendRequestAsync<TLImportedContacts>(new TLRequestImportContacts
            {
                Contacts = vectorInputPhoneContact
            }).Result;

            TLVector<TLAbsUser> vectorAbsUser = importedContacts.Users;

Does anyone know why this happens and how to fix it?

0

There are 0 answers