Carl1234
Carl1234

Reputation: 23

PROBLEM Telethon python library - (TELEGRAM)

The last year, I developed a GATE with the telethon library:

https://github.com/LonamiWebs/Telethon

The gate worked between more clients and the Telegram servers. It worked very well. At the moment it doesn't work. In my code it creates a Thread that connects to the telegram server. In the run() function of this thread, it calls the method:

self.client.add_update_handler(self.update_handler)

And then the method update_handler in the Thread manages the update...

Now, the error is the following:

self.client.add_update_handler(self.update_handler)
AttributeError: 'TelegramClient' object has no attribute 'add_update_handler'

Why?

Upvotes: 0

Views: 1004

Answers (1)

An Se
An Se

Reputation: 978

According to the Telethon changelogs:

# 4. client.add_update_handler no longer exists.
# Change this...
client.add_update_handler(handler)
# ...to this:
client.add_event_handler(handler)

Upvotes: 2

Related Questions