关于 Telegram 的 TL 语言的一些问题

2022-12-31 16:08:04 +08:00
 Roxorion

最近研究了一下 Telegram 的 API ,它是用 Telegram 官方开发的 TL 语言定义的,其中有一些语法没看明白,API 里的 flags 是干啥的,看了一下官方文档,好像是可选参数,但描述的很简单,不太清楚具体怎么处理的,比如下面这个例子

user#3ff6ecb0 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;

还有里面有一个大 X 类型,这个是不是任意类型,类似 Java 里面的 Object ,比如下面的这个例子

invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;

有老哥知道吗?

1030 次点击
所在节点    Telegram
1 条回复
dw2693734d
2022-12-31 19:32:36 +08:00

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/905787

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX