c# - 如何通过 Json 在 C# 上使用 telegram API?

标签 c# json telegram

我正在查看 telegram API 函数列表:

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

并且想知道此代码的语言名称是什么:

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

这是json类型吗?

如何用c#编写它?

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

same question

最佳答案

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

您实际上可以构建自己的 Telegram 库,以下是几个步骤:

1) 构建一个可以对 TL 进行编码和解码的 TL 解析器,这并不像听起来那么难:TL 建立在一些原始类型上,您可以查看此处的文档:https://core.telegram.org/mtproto/serialize在这里:https://core.telegram.org/mtproto/TL ,但是从这里的 TL 规范开始要容易得多:https://github.com/zhukov/webogram/blob/master/app/js/lib/schema.tl.txt ,这里:https://github.com/zhukov/webogram/blob/master/app/js/lib/config.js#L97在这里:https://github.com/zhukov/webogram/blob/master/app/js/lib/config.js#L102

2) 一旦构建了 TL 解析器,您需要学习如何创建 Auth_key。 Here is a simple guide for that

3) 您需要在 telegram.org 上注册您自己的 app_id,您需要它来识别您正在构建的 telegram 客户端。

4) 一旦您成功获取您的Auth_key,您就可以follow these additional steps找到离您最近的 Telegram 数据中心,可能会在该数据中心上重新生成您的 Auth_key,然后运行用户。身份验证命令以通过新的 Telegram 客户端在该数据中心上为您的手机号码创建 session

5)一旦您掌握了这些初始步骤,其余的命令应该会更容易。

干杯。

关于c# - 如何通过 Json 在 C# 上使用 telegram API?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35327067/

相关文章:

c# - 在一段时间内更改按钮的颜色和文本

json - 如何在 servicestack json 序列化程序中省略仅获取属性?

flutter - 如何在 flutter 中使用 Telegram api 创建消息传递模块

c# - 'await Task.Delay(1000)' 会阻塞任何线程吗?

c# - 来自 MemoryStream 的 UWP BitmapImage SetSource 挂起

c# - 动态删除菜单项 : Dispose calls Remove

caching - telegram 的answerCallbackquery API 中的cache_time 有何作用?

c++ - Boost ptree 顶级数组

php - 使用 PHP AWS SDK 在 DynamoDB 中存储 JSON 文档

api - Telegram Bot API : voice message audio spectrogram is missing. 一个错误?