diff --git a/telethon/network/mtproto_sender.py b/telethon/network/mtproto_sender.py index acda8f05..6ce8a167 100644 --- a/telethon/network/mtproto_sender.py +++ b/telethon/network/mtproto_sender.py @@ -329,7 +329,7 @@ class MtProtoSender: if self.session.report_errors and request: error = rpc_message_to_error( reader.read_int(), reader.tgread_string(), - report_method=type(request).constructor_id + report_method=type(request).CONSTRUCTOR_ID ) else: error = rpc_message_to_error( diff --git a/telethon/telegram_client.py b/telethon/telegram_client.py index fe140652..0d04ff27 100644 --- a/telethon/telegram_client.py +++ b/telethon/telegram_client.py @@ -581,7 +581,7 @@ class TelegramClient(TelegramBareClient): return reply_to if isinstance(reply_to, TLObject) and \ - type(reply_to).subclass_of_id == 0x790009e3: + type(reply_to).SUBCLASS_OF_ID == 0x790009e3: # hex(crc32(b'Message')) = 0x790009e3 return reply_to.id diff --git a/telethon/tl/gzip_packed.py b/telethon/tl/gzip_packed.py index 9a0d547a..05453d4b 100644 --- a/telethon/tl/gzip_packed.py +++ b/telethon/tl/gzip_packed.py @@ -5,7 +5,7 @@ from . import TLObject class GzipPacked(TLObject): - constructor_id = 0x3072cfa1 + CONSTRUCTOR_ID = 0x3072cfa1 def __init__(self, data): super().__init__() @@ -29,7 +29,7 @@ class GzipPacked(TLObject): def to_bytes(self): # TODO Maybe compress level could be an option - return struct.pack('