Source code for hydrogram.raw.functions.account.install_theme
# 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]classInstallTheme(TLObject):# type: ignore"""Install a theme Details: - Layer: ``181`` - ID: ``C727BB3B`` Parameters: dark (``bool``, *optional*): Whether to install the dark version theme (:obj:`InputTheme <hydrogram.raw.base.InputTheme>`, *optional*): Theme to install format (``str``, *optional*): Theme format, a string that identifies the theming engines supported by the client base_theme (:obj:`BaseTheme <hydrogram.raw.base.BaseTheme>`, *optional*): Indicates a basic theme provided by all clients Returns: ``bool`` """__slots__:List[str]=["dark","theme","format","base_theme"]ID=0xc727bb3bQUALNAME="functions.account.InstallTheme"def__init__(self,*,dark:Optional[bool]=None,theme:"raw.base.InputTheme"=None,format:Optional[str]=None,base_theme:"raw.base.BaseTheme"=None)->None:self.dark=dark# flags.0?trueself.theme=theme# flags.1?InputThemeself.format=format# flags.2?stringself.base_theme=base_theme# flags.3?BaseTheme@staticmethoddefread(b:BytesIO,*args:Any)->"InstallTheme":flags=Int.read(b)dark=Trueifflags&(1<<0)elseFalsetheme=TLObject.read(b)ifflags&(1<<1)elseNoneformat=String.read(b)ifflags&(1<<2)elseNonebase_theme=TLObject.read(b)ifflags&(1<<3)elseNonereturnInstallTheme(dark=dark,theme=theme,format=format,base_theme=base_theme)defwrite(self,*args)->bytes:b=BytesIO()b.write(Int(self.ID,False))flags=0flags|=(1<<0)ifself.darkelse0flags|=(1<<1)ifself.themeisnotNoneelse0flags|=(1<<2)ifself.formatisnotNoneelse0flags|=(1<<3)ifself.base_themeisnotNoneelse0b.write(Int(flags))ifself.themeisnotNone:b.write(self.theme.write())ifself.formatisnotNone:b.write(String(self.format))ifself.base_themeisnotNone:b.write(self.base_theme.write())returnb.getvalue()