mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-11-12 12:00:37 +00:00
Rename constructor/subclass_of_id to upper case, keep only static
This commit is contained in:
@@ -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('<I', GzipPacked.constructor_id) + \
|
||||
return struct.pack('<I', GzipPacked.CONSTRUCTOR_ID) + \
|
||||
TLObject.serialize_bytes(gzip.compress(self.data))
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -4,7 +4,7 @@ from . import TLObject
|
||||
|
||||
|
||||
class MessageContainer(TLObject):
|
||||
constructor_id = 0x73f1f8dc
|
||||
CONSTRUCTOR_ID = 0x73f1f8dc
|
||||
|
||||
def __init__(self, messages):
|
||||
super().__init__()
|
||||
@@ -13,7 +13,7 @@ class MessageContainer(TLObject):
|
||||
|
||||
def to_bytes(self):
|
||||
return struct.pack(
|
||||
'<Ii', MessageContainer.constructor_id, len(self.messages)
|
||||
'<Ii', MessageContainer.CONSTRUCTOR_ID, len(self.messages)
|
||||
) + b''.join(m.to_bytes() for m in self.messages)
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -9,7 +9,6 @@ class TLObject:
|
||||
self.rpc_error = None
|
||||
|
||||
# These should be overrode
|
||||
self.constructor_id = 0
|
||||
self.content_related = False # Only requests/functions/queries are
|
||||
|
||||
# These should not be overrode
|
||||
|
||||
Reference in New Issue
Block a user