Source code for hydrogram.raw.functions.account.upload_ringtone
# 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]classUploadRingtone(TLObject):# type: ignore"""Upload notification sound, use account.saveRingtone to convert it and add it to the list of saved notification sounds. Details: - Layer: ``181`` - ID: ``831A83A2`` Parameters: file (:obj:`InputFile <hydrogram.raw.base.InputFile>`): Notification sound file_name (``str``): File name mime_type (``str``): MIME type of file Returns: :obj:`Document <hydrogram.raw.base.Document>` """__slots__:List[str]=["file","file_name","mime_type"]ID=0x831a83a2QUALNAME="functions.account.UploadRingtone"def__init__(self,*,file:"raw.base.InputFile",file_name:str,mime_type:str)->None:self.file=file# InputFileself.file_name=file_name# stringself.mime_type=mime_type# string@staticmethoddefread(b:BytesIO,*args:Any)->"UploadRingtone":# No flagsfile=TLObject.read(b)file_name=String.read(b)mime_type=String.read(b)returnUploadRingtone(file=file,file_name=file_name,mime_type=mime_type)defwrite(self,*args)->bytes:b=BytesIO()b.write(Int(self.ID,False))# No flagsb.write(self.file.write())b.write(String(self.file_name))b.write(String(self.mime_type))returnb.getvalue()