Telethon
Telethon copied to clipboard
AttributeError: 'TelegramClient' object has no attribute '_event_builders'
I'm using Telethon v2 and I'm getting this exception:
Code
from telethon import TelegramClient
from telethon.events import NewMessage
api_id = 000
api_hash = '000'
channel_id = -100000
client = TelegramClient('test', api_id, api_hash)
@client.on(NewMessage(channel_id))
async def callback(event):
print(event)
Traceback
Traceback (most recent call last):
File "code.py", line 11, in <module>
async def callback(event):
File "venv\lib\site-packages\telethon\_client\updates.py", line 38, in decorator
self.add_event_handler(f, event)
File "venv\lib\site-packages\telethon\_client\updates.py", line 58, in add_event_handler
self._event_builders.append((event, callback))
AttributeError: 'TelegramClient' object has no attribute '_event_builders'
Also, somehow, I needed to install markdown-it-py by myself cause it didn't consider it as a requirement, so maybe something was wrong with the way I installed Telethon v2?
v2 is still in the works and pretty much not ready for use yet (it's missing a few changes and then a lot of testing and docs updates).
So the update for restricted contect channels is irrelevant at the moment? Cause this is why I tried to update to v2
Closing since v2 is not yet ready for public use, and this error should not be present in the currently-published v1.25 available from PyPi.