"""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 TypeBotCommand, TypeBotCommandScope, TypeBotMenuButton, TypeChatAdminRights, TypeDataJSON, TypeInputUser class AllowSendMessageRequest(TLRequest): CONSTRUCTOR_ID = 0xf132e3ef SUBCLASS_OF_ID = 0x8af52aac def __init__(self, bot: 'TypeInputUser'): """ :returns Updates: Instance of either UpdatesTooLong, UpdateShortMessage, UpdateShortChatMessage, UpdateShort, UpdatesCombined, Updates, UpdateShortSentMessage. """ self.bot = bot async def resolve(self, client, utils): self.bot = utils.get_input_user(await client.get_input_entity(self.bot)) def to_dict(self): return { '_': 'AllowSendMessageRequest', 'bot': self.bot.to_dict() if isinstance(self.bot, TLObject) else self.bot } def _bytes(self): return b''.join(( b'\xef\xe32\xf1', self.bot._bytes(), )) @classmethod def from_reader(cls, reader): _bot = reader.tgread_object() return cls(bot=_bot) class AnswerWebhookJSONQueryRequest(TLRequest): CONSTRUCTOR_ID = 0xe6213f4d SUBCLASS_OF_ID = 0xf5b399ac def __init__(self, query_id: int, data: 'TypeDataJSON'): """ :returns Bool: This type has no constructors. """ self.query_id = query_id self.data = data def to_dict(self): return { '_': 'AnswerWebhookJSONQueryRequest', 'query_id': self.query_id, 'data': self.data.to_dict() if isinstance(self.data, TLObject) else self.data } def _bytes(self): return b''.join(( b'M?!\xe6', struct.pack(': This type has no constructors. """ self.scope = scope self.lang_code = lang_code def to_dict(self): return { '_': 'GetBotCommandsRequest', 'scope': self.scope.to_dict() if isinstance(self.scope, TLObject) else self.scope, 'lang_code': self.lang_code } def _bytes(self): return b''.join(( b'\xd6\rL\xe3', self.scope._bytes(), self.serialize_bytes(self.lang_code), )) @classmethod def from_reader(cls, reader): _scope = reader.tgread_object() _lang_code = reader.tgread_string() return cls(scope=_scope, lang_code=_lang_code) class GetBotInfoRequest(TLRequest): CONSTRUCTOR_ID = 0xdcd914fd SUBCLASS_OF_ID = 0xca7b2235 def __init__(self, lang_code: str, bot: Optional['TypeInputUser']=None): """ :returns bots.BotInfo: Instance of BotInfo. """ self.lang_code = lang_code self.bot = bot async def resolve(self, client, utils): if self.bot: self.bot = utils.get_input_user(await client.get_input_entity(self.bot)) def to_dict(self): return { '_': 'GetBotInfoRequest', 'lang_code': self.lang_code, 'bot': self.bot.to_dict() if isinstance(self.bot, TLObject) else self.bot } def _bytes(self): return b''.join(( b'\xfd\x14\xd9\xdc', struct.pack('