"""File generated by TLObjects' generator. All changes will be ERASED""" from ...tl.tlobject import TLObject from ...tl.tlobject import TLRequest from typing import Optional, List, Union, TYPE_CHECKING import os import struct from datetime import datetime if TYPE_CHECKING: from ...tl.types import TypeChatBannedRights, TypeChatReactions, TypeDataJSON, TypeDialogFilter, TypeInlineBotSwitchPM, TypeInlineBotWebView, TypeInputBotApp, TypeInputBotInlineMessageID, TypeInputBotInlineResult, TypeInputChatPhoto, TypeInputCheckPasswordSRP, TypeInputDialogPeer, TypeInputDocument, TypeInputEncryptedChat, TypeInputEncryptedFile, TypeInputFile, TypeInputGeoPoint, TypeInputMedia, TypeInputMessage, TypeInputPeer, TypeInputQuickReplyShortcut, TypeInputReplyTo, TypeInputSingleMedia, TypeInputStickerSet, TypeInputStickeredMedia, TypeInputUser, TypeInputWallPaper, TypeMessageEntity, TypeMessagesFilter, TypeReaction, TypeReplyMarkup, TypeReportReason, TypeSendMessageAction, TypeShippingOption, TypeTextWithEntities, TypeWallPaperSettings class AcceptEncryptionRequest(TLRequest): CONSTRUCTOR_ID = 0x3dbc0415 SUBCLASS_OF_ID = 0x6d28a37a def __init__(self, peer: 'TypeInputEncryptedChat', g_b: bytes, key_fingerprint: int): """ :returns EncryptedChat: Instance of either EncryptedChatEmpty, EncryptedChatWaiting, EncryptedChatRequested, EncryptedChat, EncryptedChatDiscarded. """ self.peer = peer self.g_b = g_b self.key_fingerprint = key_fingerprint def to_dict(self): return { '_': 'AcceptEncryptionRequest', 'peer': self.peer.to_dict() if isinstance(self.peer, TLObject) else self.peer, 'g_b': self.g_b, 'key_fingerprint': self.key_fingerprint } def _bytes(self): return b''.join(( b'\x15\x04\xbc=', self.peer._bytes(), self.serialize_bytes(self.g_b), struct.pack('', self.serialize_bytes(self.hash), )) @classmethod def from_reader(cls, reader): _hash = reader.tgread_string() return cls(hash=_hash) class CheckHistoryImportRequest(TLRequest): CONSTRUCTOR_ID = 0x43fe19f3 SUBCLASS_OF_ID = 0x5bb2720b def __init__(self, import_head: str): """ :returns messages.HistoryImportParsed: Instance of HistoryImportParsed. """ self.import_head = import_head def to_dict(self): return { '_': 'CheckHistoryImportRequest', 'import_head': self.import_head } def _bytes(self): return b''.join(( b'\xf3\x19\xfeC', self.serialize_bytes(self.import_head), )) @classmethod def from_reader(cls, reader): _import_head = reader.tgread_string() return cls(import_head=_import_head) class CheckHistoryImportPeerRequest(TLRequest): CONSTRUCTOR_ID = 0x5dc60f03 SUBCLASS_OF_ID = 0xb84bb337 def __init__(self, peer: 'TypeInputPeer'): """ :returns messages.CheckedHistoryImportPeer: Instance of CheckedHistoryImportPeer. """ self.peer = peer async def resolve(self, client, utils): self.peer = utils.get_input_peer(await client.get_input_entity(self.peer)) def to_dict(self): return { '_': 'CheckHistoryImportPeerRequest', 'peer': self.peer.to_dict() if isinstance(self.peer, TLObject) else self.peer } def _bytes(self): return b''.join(( b'\x03\x0f\xc6]', self.peer._bytes(), )) @classmethod def from_reader(cls, reader): _peer = reader.tgread_object() return cls(peer=_peer) class CheckQuickReplyShortcutRequest(TLRequest): CONSTRUCTOR_ID = 0xf1d0fbd3 SUBCLASS_OF_ID = 0xf5b399ac def __init__(self, shortcut: str): """ :returns Bool: This type has no constructors. """ self.shortcut = shortcut def to_dict(self): return { '_': 'CheckQuickReplyShortcutRequest', 'shortcut': self.shortcut } def _bytes(self): return b''.join(( b'\xd3\xfb\xd0\xf1', self.serialize_bytes(self.shortcut), )) @classmethod def from_reader(cls, reader): _shortcut = reader.tgread_string() return cls(shortcut=_shortcut) class ClearAllDraftsRequest(TLRequest): CONSTRUCTOR_ID = 0x7e58ee9c SUBCLASS_OF_ID = 0xf5b399ac def to_dict(self): return { '_': 'ClearAllDraftsRequest' } def _bytes(self): return b''.join(( b'\x9c\xeeX~', )) @classmethod def from_reader(cls, reader): return cls() class ClearRecentReactionsRequest(TLRequest): CONSTRUCTOR_ID = 0x9dfeefb4 SUBCLASS_OF_ID = 0xf5b399ac def to_dict(self): return { '_': 'ClearRecentReactionsRequest' } def _bytes(self): return b''.join(( b'\xb4\xef\xfe\x9d', )) @classmethod def from_reader(cls, reader): return cls() class ClearRecentStickersRequest(TLRequest): CONSTRUCTOR_ID = 0x8999602d SUBCLASS_OF_ID = 0xf5b399ac def __init__(self, attached: Optional[bool]=None): """ :returns Bool: This type has no constructors. """ self.attached = attached def to_dict(self): return { '_': 'ClearRecentStickersRequest', 'attached': self.attached } def _bytes(self): return b''.join(( b'-`\x99\x89', struct.pack(': This type has no constructors. """ self.media = media def to_dict(self): return { '_': 'GetAttachedStickersRequest', 'media': self.media.to_dict() if isinstance(self.media, TLObject) else self.media } def _bytes(self): return b''.join(( b'\xccg[\xcc', self.media._bytes(), )) @classmethod def from_reader(cls, reader): _media = reader.tgread_object() return cls(media=_media) class GetAvailableEffectsRequest(TLRequest): CONSTRUCTOR_ID = 0xdea20a39 SUBCLASS_OF_ID = 0x4470d5bd def __init__(self, hash: int): """ :returns messages.AvailableEffects: Instance of either AvailableEffectsNotModified, AvailableEffects. """ self.hash = hash def to_dict(self): return { '_': 'GetAvailableEffectsRequest', 'hash': self.hash } def _bytes(self): return b''.join(( b'9\n\xa2\xde', struct.pack(': This type has no constructors. """ self.document_id = document_id def to_dict(self): return { '_': 'GetCustomEmojiDocumentsRequest', 'document_id': [] if self.document_id is None else self.document_id[:] } def _bytes(self): return b''.join(( b'T\x0f\xab\xd9', b'\x15\xc4\xb5\x1c',struct.pack(': This type has no constructors. """ self.lang_codes = lang_codes def to_dict(self): return { '_': 'GetEmojiKeywordsLanguagesRequest', 'lang_codes': [] if self.lang_codes is None else self.lang_codes[:] } def _bytes(self): return b''.join(( b'\xb2c\x99N', b'\x15\xc4\xb5\x1c',struct.pack(': This type has no constructors. """ self.peer = peer self.msg_id = msg_id async def resolve(self, client, utils): self.peer = utils.get_input_peer(await client.get_input_entity(self.peer)) def to_dict(self): return { '_': 'GetFactCheckRequest', 'peer': self.peer.to_dict() if isinstance(self.peer, TLObject) else self.peer, 'msg_id': [] if self.msg_id is None else self.msg_id[:] } def _bytes(self): return b''.join(( b'\xee\xc5\xcd\xb9', self.peer._bytes(), b'\x15\xc4\xb5\x1c',struct.pack(': This type has no constructors. """ self.peer = peer self.msg_id = msg_id async def resolve(self, client, utils): self.peer = utils.get_input_peer(await client.get_input_entity(self.peer)) def to_dict(self): return { '_': 'GetMessageReadParticipantsRequest', 'peer': self.peer.to_dict() if isinstance(self.peer, TLObject) else self.peer, 'msg_id': self.msg_id } def _bytes(self): return b''.join(( b'O\xc4\xc11', self.peer._bytes(), struct.pack(': This type has no constructors. """ self.peer = peer self.filters = filters self.saved_peer_id = saved_peer_id self.top_msg_id = top_msg_id async def resolve(self, client, utils): self.peer = utils.get_input_peer(await client.get_input_entity(self.peer)) if self.saved_peer_id: self.saved_peer_id = utils.get_input_peer(await client.get_input_entity(self.saved_peer_id)) def to_dict(self): return { '_': 'GetSearchCountersRequest', 'peer': self.peer.to_dict() if isinstance(self.peer, TLObject) else self.peer, 'filters': [] if self.filters is None else [x.to_dict() if isinstance(x, TLObject) else x for x in self.filters], 'saved_peer_id': self.saved_peer_id.to_dict() if isinstance(self.saved_peer_id, TLObject) else self.saved_peer_id, 'top_msg_id': self.top_msg_id } def _bytes(self): return b''.join(( b'\x00\xf3\xbc\x1b', struct.pack(': This type has no constructors. """ self.max_id = max_id def to_dict(self): return { '_': 'ReceivedMessagesRequest', 'max_id': self.max_id } def _bytes(self): return b''.join(( b'\xc0T\xa9\x05', struct.pack(': This type has no constructors. """ self.max_qts = max_qts def to_dict(self): return { '_': 'ReceivedQueueRequest', 'max_qts': self.max_qts } def _bytes(self): return b''.join(( b'f\xbb\xa5U', struct.pack('', struct.pack('\x94X', struct.pack('