You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

关于Telegram中MessageFwdHeader类型内saved_from_peer与saved_from_msg_id字段实际含义的疑问

关于Telegram中MessageFwdHeader类型内saved_from_peer与saved_from_msg_id字段实际含义的疑问

我最近在研究Telegram的消息转发逻辑,本来觉得已经摸得差不多了,但碰到两个字段有点搞不懂,想请教下大家。

先给大家梳理下我已经明白的部分:Telegram里的消息可以在用户、普通聊天、频道之间互相转发,被转发的消息里会有个fwd_from字段,类型是messageFwdHeader。这个对象里的from_id字段能告诉我们消息最初是从哪个用户或频道发出来的;如果原消息是频道发布的,还会有channel_post字段带着原消息的ID。看起来不管消息被转发多少次,我们都能追踪到最初的作者ID和原消息的ID,这部分逻辑很清晰。

但问题来了,messageFwdHeader里还有saved_from_peer和saved_from_msg_id这两个字段。我查了官方文档,说明是这样的:

saved_from_peer [...] Only for messages forwarded to the current user (inputPeerSelf), full info about the user/channel that originally sent the message
saved_from_msg_id [...] Only for messages forwarded to the current user (inputPeerSelf), ID of the message that was forwarded from the original user/channel

我就有点懵了——这不就是from_id和channel_post已经提供的信息吗?对比下from_id和saved_from_peer的定义:一个是“最初发送消息的用户ID”,一个是“最初发送消息的用户/频道的完整信息”,但这两个字段的类型是一样的啊,定义也没什么本质区别。

有没有大佬能解释下,这两个saved_*字段到底实际是用来做什么的?和已有的from_id、channel_post有什么不同?

备注:内容来源于stack exchange,提问作者winwin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.22 14:28:06