"""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, TypeInlineQueryPeerType, TypeInputBotApp, TypeInputBotInlineMessageID, TypeInputBotInlineResult, TypeInputChatPhoto, TypeInputChatTheme, TypeInputCheckPasswordSRP, TypeInputDialogPeer, TypeInputDocument, TypeInputEncryptedChat, TypeInputEncryptedFile, TypeInputFile, TypeInputGeoPoint, TypeInputMedia, TypeInputMessage, TypeInputMessageReadMetric, TypeInputPeer, TypeInputQuickReplyShortcut, TypeInputReplyTo, TypeInputSingleMedia, TypeInputStickerSet, TypeInputStickeredMedia, TypeInputUser, TypeInputWallPaper, TypeMessageEntity, TypeMessagesFilter, TypePaidReactionPrivacy, TypePollAnswer, TypeReaction, TypeReplyMarkup, TypeSendMessageAction, TypeShippingOption, TypeStarsSubscriptionPricing, TypeSuggestedPost, TypeTextWithEntities, TypeTodoItem, 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 CheckUrlAuthMatchCodeRequest(TLRequest): CONSTRUCTOR_ID = 0xc9a47b0b SUBCLASS_OF_ID = 0xf5b399ac def __init__(self, url: str, match_code: str): """ :returns Bool: This type has no constructors. """ self.url = url self.match_code = match_code def to_dict(self): return { '_': 'CheckUrlAuthMatchCodeRequest', 'url': self.url, 'match_code': self.match_code } def _bytes(self): return b''.join(( b'\x0b{\xa4\xc9', self.serialize_bytes(self.url), self.serialize_bytes(self.match_code), )) @classmethod def from_reader(cls, reader): _url = reader.tgread_string() _match_code = reader.tgread_string() return cls(url=_url, match_code=_match_code) 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('