Source code for hydrogram.raw.functions.account.update_profile
# 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]classUpdateProfile(TLObject):# type: ignore"""Updates user profile. Details: - Layer: ``181`` - ID: ``78515775`` Parameters: first_name (``str``, *optional*): New user first name last_name (``str``, *optional*): New user last name about (``str``, *optional*): New bio Returns: :obj:`User <hydrogram.raw.base.User>` """__slots__:List[str]=["first_name","last_name","about"]ID=0x78515775QUALNAME="functions.account.UpdateProfile"def__init__(self,*,first_name:Optional[str]=None,last_name:Optional[str]=None,about:Optional[str]=None)->None:self.first_name=first_name# flags.0?stringself.last_name=last_name# flags.1?stringself.about=about# flags.2?string@staticmethoddefread(b:BytesIO,*args:Any)->"UpdateProfile":flags=Int.read(b)first_name=String.read(b)ifflags&(1<<0)elseNonelast_name=String.read(b)ifflags&(1<<1)elseNoneabout=String.read(b)ifflags&(1<<2)elseNonereturnUpdateProfile(first_name=first_name,last_name=last_name,about=about)defwrite(self,*args)->bytes:b=BytesIO()b.write(Int(self.ID,False))flags=0flags|=(1<<0)ifself.first_nameisnotNoneelse0flags|=(1<<1)ifself.last_nameisnotNoneelse0flags|=(1<<2)ifself.aboutisnotNoneelse0b.write(Int(flags))ifself.first_nameisnotNone:b.write(String(self.first_name))ifself.last_nameisnotNone:b.write(String(self.last_name))ifself.aboutisnotNone:b.write(String(self.about))returnb.getvalue()