Source code for hydrogram.raw.functions.channels.delete_history
# 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]classDeleteHistory(TLObject):# type: ignore"""Delete the history of a supergroup Details: - Layer: ``181`` - ID: ``9BAA9647`` Parameters: channel (:obj:`InputChannel <hydrogram.raw.base.InputChannel>`): Supergroup whose history must be deleted max_id (``int`` ``32-bit``): ID of message up to which the history must be deleted for_everyone (``bool``, *optional*): Whether the history should be deleted for everyone Returns: :obj:`Updates <hydrogram.raw.base.Updates>` """__slots__:List[str]=["channel","max_id","for_everyone"]ID=0x9baa9647QUALNAME="functions.channels.DeleteHistory"def__init__(self,*,channel:"raw.base.InputChannel",max_id:int,for_everyone:Optional[bool]=None)->None:self.channel=channel# InputChannelself.max_id=max_id# intself.for_everyone=for_everyone# flags.0?true@staticmethoddefread(b:BytesIO,*args:Any)->"DeleteHistory":flags=Int.read(b)for_everyone=Trueifflags&(1<<0)elseFalsechannel=TLObject.read(b)max_id=Int.read(b)returnDeleteHistory(channel=channel,max_id=max_id,for_everyone=for_everyone)defwrite(self,*args)->bytes:b=BytesIO()b.write(Int(self.ID,False))flags=0flags|=(1<<0)ifself.for_everyoneelse0b.write(Int(flags))b.write(self.channel.write())b.write(Int(self.max_id))returnb.getvalue()