如何通过Json在C#上使用电报API? [英] how to use telegram API on c# via Json?

查看:134
本文介绍了如何通过Json在C#上使用电报API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看以下电报API函数列表:

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)
)

这是json类型吗?

我如何在C#上编写它?

how can i write it on c#?

在哪里可以找到示例应用程序?

where can i find a sample application?

相同的问题

推荐答案

电报有自己的内部编码语言,称为TL.它用于描述电报服务器可以理解的所有类型和命令.

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)构建一个可以与TL进行编码和从TL进行编码和解码的TL解析器,这并不像听起来那么难:TL建立在一些原始类型上,您可以在此处查看文档: https://core.telegram.org/mtproto/serialize 和此处: https://github.com/zhukov/webogram /blob/master/app/js/lib/schema.tl.txt ,在这里: https://githu b.com/zhukov/webogram/blob/master/app/js/lib/config.js#L102

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)构建TL分析器后,您需要学习如何创建Auth_key. 这是一个简单的指南

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)您需要在telegram.org上注册自己的app_id,需要该身份来标识您正在构建的电报客户端.

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)成功获取Auth_key后,您可以按照以下附加步骤查找离您最近的电报数据-center,可能会在该数据中心上重新生成您的Auth_key,然后运行用户.身份验证命令可通过新的电报客户端在该数据中心上为您的手机号码创建会话

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)一旦掌握了这些初始步骤,其余的命令应该会更容易.

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

欢呼.

这篇关于如何通过Json在C#上使用电报API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆