Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/326.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
问题Telethon python库-(电报)_Python_Telegram_Telethon - Fatal编程技术网

问题Telethon python库-(电报)

问题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

去年,我与telethon图书馆合作开发了一个GATE:

门在更多的客户端和电报服务器之间工作。它工作得很好。 目前它不起作用。 在我的代码中,它创建了一个连接到电报服务器的线程。在该线程的run()函数中,它调用以下方法:

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)