Source code for hydrogram.raw.functions.stickers.set_sticker_set_thumb
# 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]classSetStickerSetThumb(TLObject):# type: ignore"""Set stickerset thumbnail Details: - Layer: ``181`` - ID: ``A76A5392`` Parameters: stickerset (:obj:`InputStickerSet <hydrogram.raw.base.InputStickerSet>`): Stickerset thumb (:obj:`InputDocument <hydrogram.raw.base.InputDocument>`, *optional*): Thumbnail (only for normal stickersets, not custom emoji stickersets). thumb_document_id (``int`` ``64-bit``, *optional*): Only for custom emoji stickersets, ID of a custom emoji present in the set to use as thumbnail; pass 0 to fallback to the first custom emoji of the set. Returns: :obj:`messages.StickerSet <hydrogram.raw.base.messages.StickerSet>` """__slots__:List[str]=["stickerset","thumb","thumb_document_id"]ID=0xa76a5392QUALNAME="functions.stickers.SetStickerSetThumb"def__init__(self,*,stickerset:"raw.base.InputStickerSet",thumb:"raw.base.InputDocument"=None,thumb_document_id:Optional[int]=None)->None:self.stickerset=stickerset# InputStickerSetself.thumb=thumb# flags.0?InputDocumentself.thumb_document_id=thumb_document_id# flags.1?long@staticmethoddefread(b:BytesIO,*args:Any)->"SetStickerSetThumb":flags=Int.read(b)stickerset=TLObject.read(b)thumb=TLObject.read(b)ifflags&(1<<0)elseNonethumb_document_id=Long.read(b)ifflags&(1<<1)elseNonereturnSetStickerSetThumb(stickerset=stickerset,thumb=thumb,thumb_document_id=thumb_document_id)defwrite(self,*args)->bytes:b=BytesIO()b.write(Int(self.ID,False))flags=0flags|=(1<<0)ifself.thumbisnotNoneelse0flags|=(1<<1)ifself.thumb_document_idisnotNoneelse0b.write(Int(flags))b.write(self.stickerset.write())ifself.thumbisnotNone:b.write(self.thumb.write())ifself.thumb_document_idisnotNone:b.write(Long(self.thumb_document_id))returnb.getvalue()