import logging import struct from .tlmessage import TLMessage from ..tlobject import TLObject __log__ = logging.getLogger(__name__) class MessageContainer(TLObject): CONSTRUCTOR_ID = 0x73f1f8dc def __init__(self, messages): super().__init__() self.content_related = False self.messages = messages def to_dict(self, recursive=True): return { 'content_related': self.content_related, 'messages': ([] if self.messages is None else [ None if x is None else x.to_dict() for x in self.messages ]) if recursive else self.messages, } def __bytes__(self): return struct.pack( '