how to use telegram API on c# via Json?

孤街醉人 提交于 2019-12-10 23:40:17

问题


i was looking at telegram API functions list at:

https://core.telegram.org/method/auth.checkPhone

and want to know what's the language name of this codes:

(auth.checkPhone "1548789888")"=
(auth.checkedPhone
  phone_registered:(boolFalse)
  phone_invited:(boolFalse)
)

is this json type?

how can i write it on c#?

where can i find a sample application?

same question


回答1:


Telegram has its own internal encoding language called TL. It is used to describe all the types as well as commands that Telegram Servers understand.

You can actually build your own Telegram library, here are a few steps:

1) build a TL parser that can encode and decode to and from TL, this is not as hard as it sounds: TL builds up on a few primitive types,you can take a look at the documentation here: https://core.telegram.org/mtproto/serialize and here: https://core.telegram.org/mtproto/TL, but it's alot easier to start from the TL spec here: https://github.com/zhukov/webogram/blob/master/app/js/lib/schema.tl.txt, here: https://github.com/zhukov/webogram/blob/master/app/js/lib/config.js#L97 and here: https://github.com/zhukov/webogram/blob/master/app/js/lib/config.js#L102

2) once you have built your TL parser you need to learn how to create an Auth_key. Here is a simple guide for that

3) You would need to register for your own app_id on telegram.org, you would need that to identify the telegram client you are building.

4) Once you can get Your Auth_key successfully, then you can follow these additional steps to find your nearest Telegram Data-center, possibly re-generate your Auth_key on that data-center, then run the user.Authentication commands to create a session for your mobile number on that data-center via your new Telegram Client

5) once you can grasp these initial steps, the remaining commands should be easier.

cheers.



来源:https://stackoverflow.com/questions/35327067/how-to-use-telegram-api-on-c-sharp-via-json

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!