Похожие чаты

This might be a dumb question, but how can I

get the raw tl.Message or tl.MessageService event from a telethon Message object?
I've prodded around, and checked the docs, but can't see a way

11 ответов

13 просмотров

for what usecase? telethon patches the original Message with the custom one, it's still a subclass of it, so they're the same thing. you'd need to find original class and serialize it again otherwise

Deer-Spangle ️ Автор вопроса
⎞ .·. ⎝ ⎝
for what usecase? telethon patches the original Me...

Dumping raw data to dicts. Message.to_dict() doesn't seem to be implemented, and Message also combines both the tl.Message and tl.MessageService objects into one

Deer Spangle ️
Dumping raw data to dicts. Message.to_dict() doesn...

custom Message inherits everything from TL object one, to_dict() is implemented in both

Deer-Spangle ️ Автор вопроса
⎞ .·. ⎝ ⎝
custom Message inherits everything from TL object ...

Hmmm.. does it? I'm sure I was getting NotImplementedError telethon.tl.custom.message.py: class Message(ChatGetter, SenderGetter, TLObject): Has no to_dict() method defined. It composes the tl.Message and tl.MessageService objects, but doesn't inherit from them I think?

Deer Spangle ️
Hmmm.. does it? I'm sure I was getting NotImplemen...

telethon.tl.patched is the one used everywhere not the custom

Deer-Spangle ️ Автор вопроса

Ohhhh, hmm.. I'm using TelegramClient.iter_messages() and it says it yields custom.Message? And my IDE seems to agree... Are you saying it should be yielding a mix of patched.Message and patched.MessageService then? I may need to double-check later

Deer Spangle ️
Ohhhh, hmm.. I'm using TelegramClient.iter_message...

It always yields patched, since it replaces the telethon.tl.types which is main one. custom is class definition for mutual fields

Deer-Spangle ️ Автор вопроса
⎞ .·. ⎝ ⎝
It always yields patched, since it replaces the te...

Ohhh, hmm, well then! I'll have to give that another go this evening and see if it works. Whoops! Thank you

not really a nice way, there's some ugly hacks there

Deer-Spangle ️ Автор вопроса
lonami
not really a nice way, there's some ugly hacks the...

It's fine! I think I can get all I need from what NAME_UNPRONOUNCABLE advised! Don't worry about it

Deer-Spangle ️ Автор вопроса
⎞ .·. ⎝ ⎝
custom Message inherits everything from TL object ...

Ah, yup. Can confirm now, that works perfectly!

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта