Source code for hydrogram.raw.functions.messages.toggle_sticker_sets
# 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]classToggleStickerSets(TLObject):# type: ignore"""Apply changes to multiple stickersets Details: - Layer: ``181`` - ID: ``B5052FEA`` Parameters: stickersets (List of :obj:`InputStickerSet <hydrogram.raw.base.InputStickerSet>`): Stickersets to act upon uninstall (``bool``, *optional*): Uninstall the specified stickersets archive (``bool``, *optional*): Archive the specified stickersets unarchive (``bool``, *optional*): Unarchive the specified stickersets Returns: ``bool`` """__slots__:List[str]=["stickersets","uninstall","archive","unarchive"]ID=0xb5052feaQUALNAME="functions.messages.ToggleStickerSets"def__init__(self,*,stickersets:List["raw.base.InputStickerSet"],uninstall:Optional[bool]=None,archive:Optional[bool]=None,unarchive:Optional[bool]=None)->None:self.stickersets=stickersets# Vector<InputStickerSet>self.uninstall=uninstall# flags.0?trueself.archive=archive# flags.1?trueself.unarchive=unarchive# flags.2?true@staticmethoddefread(b:BytesIO,*args:Any)->"ToggleStickerSets":flags=Int.read(b)uninstall=Trueifflags&(1<<0)elseFalsearchive=Trueifflags&(1<<1)elseFalseunarchive=Trueifflags&(1<<2)elseFalsestickersets=TLObject.read(b)returnToggleStickerSets(stickersets=stickersets,uninstall=uninstall,archive=archive,unarchive=unarchive)defwrite(self,*args)->bytes:b=BytesIO()b.write(Int(self.ID,False))flags=0flags|=(1<<0)ifself.uninstallelse0flags|=(1<<1)ifself.archiveelse0flags|=(1<<2)ifself.unarchiveelse0b.write(Int(flags))b.write(Vector(self.stickersets))returnb.getvalue()