# 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]classFolder(TLObject):# type: ignore"""Folder Constructor of :obj:`~hydrogram.raw.base.Folder`. Details: - Layer: ``181`` - ID: ``FF544E65`` Parameters: id (``int`` ``32-bit``): Folder ID title (``str``): Folder title autofill_new_broadcasts (``bool``, *optional*): Automatically add new channels to this folder autofill_public_groups (``bool``, *optional*): Automatically add joined new public supergroups to this folder autofill_new_correspondents (``bool``, *optional*): Automatically add new private chats to this folder photo (:obj:`ChatPhoto <hydrogram.raw.base.ChatPhoto>`, *optional*): Folder picture """__slots__:List[str]=["id","title","autofill_new_broadcasts","autofill_public_groups","autofill_new_correspondents","photo"]ID=0xff544e65QUALNAME="types.Folder"def__init__(self,*,id:int,title:str,autofill_new_broadcasts:Optional[bool]=None,autofill_public_groups:Optional[bool]=None,autofill_new_correspondents:Optional[bool]=None,photo:"raw.base.ChatPhoto"=None)->None:self.id=id# intself.title=title# stringself.autofill_new_broadcasts=autofill_new_broadcasts# flags.0?trueself.autofill_public_groups=autofill_public_groups# flags.1?trueself.autofill_new_correspondents=autofill_new_correspondents# flags.2?trueself.photo=photo# flags.3?ChatPhoto@staticmethoddefread(b:BytesIO,*args:Any)->"Folder":flags=Int.read(b)autofill_new_broadcasts=Trueifflags&(1<<0)elseFalseautofill_public_groups=Trueifflags&(1<<1)elseFalseautofill_new_correspondents=Trueifflags&(1<<2)elseFalseid=Int.read(b)title=String.read(b)photo=TLObject.read(b)ifflags&(1<<3)elseNonereturnFolder(id=id,title=title,autofill_new_broadcasts=autofill_new_broadcasts,autofill_public_groups=autofill_public_groups,autofill_new_correspondents=autofill_new_correspondents,photo=photo)defwrite(self,*args)->bytes:b=BytesIO()b.write(Int(self.ID,False))flags=0flags|=(1<<0)ifself.autofill_new_broadcastselse0flags|=(1<<1)ifself.autofill_public_groupselse0flags|=(1<<2)ifself.autofill_new_correspondentselse0flags|=(1<<3)ifself.photoisnotNoneelse0b.write(Int(flags))b.write(Int(self.id))b.write(String(self.title))ifself.photoisnotNone:b.write(self.photo.write())returnb.getvalue()