问题Telethon python库-(电报)
去年,我与telethon图书馆合作开发了一个GATE: 门在更多的客户端和电报服务器之间工作。它工作得很好。 目前它不起作用。 在我的代码中,它创建了一个连接到电报服务器的线程。在该线程的run()函数中,它调用以下方法:问题Telethon python库-(电报),python,telegram,telethon,Python,Telegram,Telethon,去年,我与telethon图书馆合作开发了一个GATE: 门在更多的客户端和电报服务器之间工作。它工作得很好。 目前它不起作用。 在我的代码中,它创建了一个连接到电报服务器的线程。在该线程的run()函数中,它调用以下方法: self.client.add_update_handler(self.update_handler) 然后线程中的方法update\u处理程序管理更新 现在,错误如下所示: self.client.add_update_handler(self.update_hand
self.client.add_update_handler(self.update_handler)
然后线程中的方法update\u处理程序管理更新
现在,错误如下所示:
self.client.add_update_handler(self.update_handler)
AttributeError: 'TelegramClient' object has no attribute 'add_update_handler'
为什么?根据电视节目的变化记录:
# 4. client.add_update_handler no longer exists.
# Change this...
client.add_update_handler(handler)
# ...to this:
client.add_event_handler(handler)
根据Telethon的变更记录:
# 4. client.add_update_handler no longer exists.
# Change this...
client.add_update_handler(handler)
# ...to this:
client.add_event_handler(handler)