在Telegram Bot API中,更新对象可以重复update_id吗?
在更新对象中,可以重复update_id
吗?
例如,引用文档...
如果至少一周没有新的更新,则将随机选择下一个更新的标识符。
。
这是否意味着在至少一周的休息之后,有机会使用update_id
值进行更新,以用于另一个更新?
upd。引用电报支持响应:
由于更新ID应适合2^32-1,因此在技术上不可能使其独特(显而易见)并告诉我们,只有在获得更新以按时间订购时,您才能依靠顺序订购。不建议使用其他用途,也不建议更新ID的唯一性:)
In Update object, can update_id
be ever repeated?
For instance, citing documentation...
If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.
Does this mean that after a break of at least one week long, there is a chance to get an Update with update_id
value that was used in the past for another update?
UPD. Citing Telegram Support response:
As update id should fit in 2^32-1 it’s not technically possible to make it unique (which is obvious) and dev told us that you should rely on sequential order only right when get update to order them by time. Other uses are not recommended and uniqueness of update id also :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,
update_id
是唯一的!从文档中,在您的问题上引用该行:
代码> 具有独特的,否则可以使用已经使用的密钥来调用
getupdates
,然后使电报想到该ID之后的消息被看到。No, an
update_id
is unique!From the docs, quoting the line before the quote in your question:
The
update_id
has to be unique, otherwise it will be possible to callgetUpdates
with an already used key, that will then make Telegram think the messages after that id haven't already been seen.