Telegram has a peculiar API and TLSharp is of course damp. But writing your library will take a lot of time.
To begin, I would advise you to understand the API Telegram and the TL-scheme . Without this, the principle will be hard.
Before using the API, you need to register and get API_ID and API_HASH
Any changes to the telegram are contained in the Update objects. To receive a new message, an object intersects you.
updateNewMessage#13abdb3 message:Message pts:int = Update;
In TLSharpe, as I recall, they were not specially processed. But in the class TLSharp.Core.Network.MtProtoSender there is a method HandleUpdate In it you can get the Update you need.
There is an example in the documentation for sending a message.
//get available contacts var result = await client.GetContactsAsync(); //find recipient in contacts var user = result.users.lists .Where(x => x.GetType() == typeof (TLUser)) .Cast<TLUser>() .FirstOrDefault(x => x.phone == "<recipient_phone>"); //send message await client.SendMessageAsync(new TLInputPeerUser() {user_id = user.id}, "OUR_MESSAGE");
If you have no contacts, you can add them.
var userByPhoneId = await client.ImportContactByPhoneNumber("791812312323");
The current TL scheme can be viewed here . This is git web version.