Source code for hydrogram.raw.functions.messages.edit_exported_chat_invite
# 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]classEditExportedChatInvite(TLObject):# type: ignore"""Edit an exported chat invite Details: - Layer: ``181`` - ID: ``BDCA2F75`` Parameters: peer (:obj:`InputPeer <hydrogram.raw.base.InputPeer>`): Chat link (``str``): Invite link revoked (``bool``, *optional*): Whether to revoke the chat invite expire_date (``int`` ``32-bit``, *optional*): New expiration date usage_limit (``int`` ``32-bit``, *optional*): Maximum number of users that can join using this link request_needed (``bool``, *optional*): Whether admin confirmation is required before admitting each separate user into the chat title (``str``, *optional*): Description of the invite link, visible only to administrators Returns: :obj:`messages.ExportedChatInvite <hydrogram.raw.base.messages.ExportedChatInvite>` """__slots__:List[str]=["peer","link","revoked","expire_date","usage_limit","request_needed","title"]ID=0xbdca2f75QUALNAME="functions.messages.EditExportedChatInvite"def__init__(self,*,peer:"raw.base.InputPeer",link:str,revoked:Optional[bool]=None,expire_date:Optional[int]=None,usage_limit:Optional[int]=None,request_needed:Optional[bool]=None,title:Optional[str]=None)->None:self.peer=peer# InputPeerself.link=link# stringself.revoked=revoked# flags.2?trueself.expire_date=expire_date# flags.0?intself.usage_limit=usage_limit# flags.1?intself.request_needed=request_needed# flags.3?Boolself.title=title# flags.4?string@staticmethoddefread(b:BytesIO,*args:Any)->"EditExportedChatInvite":flags=Int.read(b)revoked=Trueifflags&(1<<2)elseFalsepeer=TLObject.read(b)link=String.read(b)expire_date=Int.read(b)ifflags&(1<<0)elseNoneusage_limit=Int.read(b)ifflags&(1<<1)elseNonerequest_needed=Bool.read(b)ifflags&(1<<3)elseNonetitle=String.read(b)ifflags&(1<<4)elseNonereturnEditExportedChatInvite(peer=peer,link=link,revoked=revoked,expire_date=expire_date,usage_limit=usage_limit,request_needed=request_needed,title=title)defwrite(self,*args)->bytes:b=BytesIO()b.write(Int(self.ID,False))flags=0flags|=(1<<2)ifself.revokedelse0flags|=(1<<0)ifself.expire_dateisnotNoneelse0flags|=(1<<1)ifself.usage_limitisnotNoneelse0flags|=(1<<3)ifself.request_neededisnotNoneelse0flags|=(1<<4)ifself.titleisnotNoneelse0b.write(Int(flags))b.write(self.peer.write())b.write(String(self.link))ifself.expire_dateisnotNone:b.write(Int(self.expire_date))ifself.usage_limitisnotNone:b.write(Int(self.usage_limit))ifself.request_neededisnotNone:b.write(Bool(self.request_needed))ifself.titleisnotNone:b.write(String(self.title))returnb.getvalue()