问题描述
因此,我有一个漫游器,并将@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 (将#修改为@)