Source code for hydrogram.raw.functions.messages.set_bot_shipping_results
# Hydrogram - Telegram MTProto API Client Library for Python# Copyright (C) 2023-present Hydrogram <https://hydrogram.org>## This file is part of Hydrogram.## Hydrogram is free software: you can redistribute it and/or modify# it under the terms of the GNU Lesser General Public License as published# by the Free Software Foundation, either version 3 of the License, or# (at your option) any later version.## Hydrogram is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU Lesser General Public License for more details.## You should have received a copy of the GNU Lesser General Public License# along with Hydrogram. If not, see <http://www.gnu.org/licenses/>.fromioimportBytesIOfromhydrogram.raw.core.primitivesimportInt,Long,Int128,Int256,Bool,Bytes,String,Double,Vectorfromhydrogram.raw.coreimportTLObjectfromhydrogramimportrawfromtypingimportList,Optional,Any# # # # # # # # # # # # # # # # # # # # # # # ## !!! WARNING !!! ## This is a generated file! ## All changes made in this file will be lost! ## # # # # # # # # # # # # # # # # # # # # # # #
[docs]classSetBotShippingResults(TLObject):# type: ignore"""If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the bot will receive an updateBotShippingQuery update. Use this method to reply to shipping queries. Details: - Layer: ``181`` - ID: ``E5F672FA`` Parameters: query_id (``int`` ``64-bit``): Unique identifier for the query to be answered error (``str``, *optional*): Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable"). Telegram will display this message to the user. shipping_options (List of :obj:`ShippingOption <hydrogram.raw.base.ShippingOption>`, *optional*): A vector of available shipping options. Returns: ``bool`` """__slots__:List[str]=["query_id","error","shipping_options"]ID=0xe5f672faQUALNAME="functions.messages.SetBotShippingResults"def__init__(self,*,query_id:int,error:Optional[str]=None,shipping_options:Optional[List["raw.base.ShippingOption"]]=None)->None:self.query_id=query_id# longself.error=error# flags.0?stringself.shipping_options=shipping_options# flags.1?Vector<ShippingOption>@staticmethoddefread(b:BytesIO,*args:Any)->"SetBotShippingResults":flags=Int.read(b)query_id=Long.read(b)error=String.read(b)ifflags&(1<<0)elseNoneshipping_options=TLObject.read(b)ifflags&(1<<1)else[]returnSetBotShippingResults(query_id=query_id,error=error,shipping_options=shipping_options)defwrite(self,*args)->bytes:b=BytesIO()b.write(Int(self.ID,False))flags=0flags|=(1<<0)ifself.errorisnotNoneelse0flags|=(1<<1)ifself.shipping_optionselse0b.write(Int(flags))b.write(Long(self.query_id))ifself.errorisnotNone:b.write(String(self.error))ifself.shipping_optionsisnotNone:b.write(Vector(self.shipping_options))returnb.getvalue()