Source code for hydrogram.raw.functions.messages.prolong_web_view
# 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]classProlongWebView(TLObject):# type: ignore"""Indicate to the server (from the user side) that the user is still using a web app. Details: - Layer: ``181`` - ID: ``B0D81A83`` Parameters: peer (:obj:`InputPeer <hydrogram.raw.base.InputPeer>`): Dialog where the web app was opened. bot (:obj:`InputUser <hydrogram.raw.base.InputUser>`): Bot that owns the web app query_id (``int`` ``64-bit``): Web app interaction ID obtained from messages.requestWebView silent (``bool``, *optional*): Whether the inline message that will be sent by the bot on behalf of the user once the web app interaction is terminated should be sent silently (no notifications for the receivers). reply_to (:obj:`InputReplyTo <hydrogram.raw.base.InputReplyTo>`, *optional*): If set, indicates that the inline message that will be sent by the bot on behalf of the user once the web app interaction is terminated should be sent in reply to the specified message or story. send_as (:obj:`InputPeer <hydrogram.raw.base.InputPeer>`, *optional*): Open the web app as the specified peer Returns: ``bool`` """__slots__:List[str]=["peer","bot","query_id","silent","reply_to","send_as"]ID=0xb0d81a83QUALNAME="functions.messages.ProlongWebView"def__init__(self,*,peer:"raw.base.InputPeer",bot:"raw.base.InputUser",query_id:int,silent:Optional[bool]=None,reply_to:"raw.base.InputReplyTo"=None,send_as:"raw.base.InputPeer"=None)->None:self.peer=peer# InputPeerself.bot=bot# InputUserself.query_id=query_id# longself.silent=silent# flags.5?trueself.reply_to=reply_to# flags.0?InputReplyToself.send_as=send_as# flags.13?InputPeer@staticmethoddefread(b:BytesIO,*args:Any)->"ProlongWebView":flags=Int.read(b)silent=Trueifflags&(1<<5)elseFalsepeer=TLObject.read(b)bot=TLObject.read(b)query_id=Long.read(b)reply_to=TLObject.read(b)ifflags&(1<<0)elseNonesend_as=TLObject.read(b)ifflags&(1<<13)elseNonereturnProlongWebView(peer=peer,bot=bot,query_id=query_id,silent=silent,reply_to=reply_to,send_as=send_as)defwrite(self,*args)->bytes:b=BytesIO()b.write(Int(self.ID,False))flags=0flags|=(1<<5)ifself.silentelse0flags|=(1<<0)ifself.reply_toisnotNoneelse0flags|=(1<<13)ifself.send_asisnotNoneelse0b.write(Int(flags))b.write(self.peer.write())b.write(self.bot.write())b.write(Long(self.query_id))ifself.reply_toisnotNone:b.write(self.reply_to.write())ifself.send_asisnotNone:b.write(self.send_as.write())returnb.getvalue()