Telethon: AttributeError: 'DraftMessageEmpty' object has no attribute 'message'
today i had an unexpected error for fetching my dialogs.
Traceback (most recent call last):
File "F:\App\core\main.py", line 233, in get_dialogs
ls = self.client.get_dialogs(limit=limit)
File "F:\v_env\lib\site-packages\telethon\telegram_client.py", line 664, in get_dialogs
dialogs = UserList(self.iter_dialogs(*args, **kwargs))
File "C:\Python34\lib\collections\__init__.py", line 932, in __init__
self.data = list(initlist)
File "F:\v_env\lib\site-packages\telethon\telegram_client.py", line 645, in iter_dialogs
yield Dialog(self, d, entities, messages)
File "F:\v_env\lib\site-packages\telethon\tl\custom\dialog.py", line 82, in __init__
self.draft = Draft(client, dialog.peer, dialog.draft)
File "F:\v_env\lib\site-packages\telethon\tl\custom\draft.py", line 33, in __init__
self._text = markdown.unparse(draft.message, draft.entities)
AttributeError: 'DraftMessageEmpty' object has no attribute 'message'
any idea how to fix it? my codes were OK and run perfectly. 😦
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 29 (14 by maintainers)
@wowkin2 the
telethon-sync
package also works in “sync mode” with a few changes, and (most importantly) will be maintained.pip install --no-cache --upgrade git+https://github.com/LonamiWebs/Telethon@master
.