sochix / TLSharp

Telegram client library implemented in C#
1k stars 380 forks source link

the TLContacts don't have the users definition. #814

Open kensonlai28 opened 6 years ago

kensonlai28 commented 6 years ago

//get available contacts var result = await client.GetContactsAsync();

//find recipient in contacts var user = result.users.lists .Where(x => x.GetType() == typeof(TLUser)) .Cast() .Where(x => x.first_name == "ZRX");

The result.users.lists shows an error, how could I fix it?

knocte commented 6 years ago

What error? Copy+paste the whole ex.ToString() here.

kensonlai28 commented 5 years ago

Hello,

Thank you for your help. My question is about using TLSharp. I just use the very simple form to get Telegram users' phone information.

The object returns from the client.GetContactsAsync() assigned for result variable, but it shows the error as follow. Could you please let me know how to handle it?

I am using Visual studio 2017 & C# Programming language for this application.

Error CS1061 'TLContacts' does not contain a definition for 'users' and no extension method 'users' accepting a first argument of type 'TLContacts' could be found (are you missing a using directive or an assembly reference?)

knocte commented 5 years ago

That's a compiler error, not a runtime error, which means you're not using the API properly. Are you following a sample in the documentation? Is the sample wrong?