简体   繁体   English

如何使用 python-telegram-bot API 在电报中查找第 th 条消息?

[英]How to find the 𝘯th message in telegram with the python-telegram-bot API?

How to find the th message in telegram with the python-telegram-bot API wrapper?如何使用python-telegram-bot API 包装器在电报中查找第th条消息? I read the documentation fully and looked at tutorials such as this one but to no avail.我完整阅读了文档并查看了诸如此类教程,但无济于事。 It follows an updater mechanism so I can only receive new messages and reply to them.它遵循更新机制,所以我只能接收新消息并回复它们。

I know I can create a list in which I store all the updates as they come but there's going to be millions of long messages and I was wondering if there was any proper way to do this.我知道我可以创建一个列表,在其中存储所有更新,但会有数百万条长消息,我想知道是否有任何适当的方法可以做到这一点。 I am new to this wrapper and would really appreciate any sort of help.我是这个包装器的新手,非常感谢任何形式的帮助。 So, how would I write a program to find the th message in a chat with my bot?那么,我将如何编写一个程序来在与我的机器人聊天中找到第 th 条消息? The message can be either by the user or the bot.消息可以来自用户或机器人。

As already answered here , the Telegram Bot API doesn't offer a get_message_by_id method or similar functionality and so python-telegram-bot can't either.正如这里已经回答的那样,Telegram Bot API 不提供get_message_by_id方法或类似功能,因此python-telegram-bot也不能。 So if you want to get all the details for every message by its message id, you have no choice than keeping track of them yourself.因此,如果您想通过消息 ID 获取每条消息的所有详细信息,您别无选择,只能自己跟踪它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM