隐私设置为禁用的Telegram Bot应该能够从一个组中读取最近的100条消息-如何在我的漫游器中实现?

问题描述

因此,我有一个漫游器,并将@botfather的“隐私”设置为“禁用”,因此该漫游器可以访问论坛的消息。当我尝试将其添加到组中时,Telegram向我发送了一条通知通知该漫游器一旦添加到组中,便可以访问该组中的最后100条消息。

如何在我的机器人代码中实现呢?由于限制为100,我想这与GetUpdates函数有关,但是无论我设置了什么偏移值,该漫游器都不会返回它被添加到该组之前发送的消息(我什至尝试设置随机数以查看是否有东西会改变)。这是使用Telepot的相关代码

bot = telepot.Bot(token)

def handle(msg):
    content_type,chat_type,chat_id = telepot.glance(msg)
    #rest of code handling text messages

pprint(bot.getUpdates()) #no differences in results for varIoUs parameters passed to function
print("one time operation done\nbeginning loop")
#in theory the bot should get the last 100 messages in the group with getUpdates as a one-time operation and then start the loop

telepot.loop.MessageLoop(bot,handle).run_as_thread() #start loop
while 1:
    time.sleep(10)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...