Source code for hydrogram.raw.functions.channels.get_admin_log
# 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]classGetAdminLog(TLObject):# type: ignore"""Get the admin log of a channel/supergroup Details: - Layer: ``181`` - ID: ``33DDF480`` Parameters: channel (:obj:`InputChannel <hydrogram.raw.base.InputChannel>`): Channel q (``str``): Search query, can be empty max_id (``int`` ``64-bit``): Maximum ID of message to return (see pagination) min_id (``int`` ``64-bit``): Minimum ID of message to return (see pagination) limit (``int`` ``32-bit``): Maximum number of results to return, see pagination events_filter (:obj:`ChannelAdminLogEventsFilter <hydrogram.raw.base.ChannelAdminLogEventsFilter>`, *optional*): Event filter admins (List of :obj:`InputUser <hydrogram.raw.base.InputUser>`, *optional*): Only show events from these admins Returns: :obj:`channels.AdminLogResults <hydrogram.raw.base.channels.AdminLogResults>` """__slots__:List[str]=["channel","q","max_id","min_id","limit","events_filter","admins"]ID=0x33ddf480QUALNAME="functions.channels.GetAdminLog"def__init__(self,*,channel:"raw.base.InputChannel",q:str,max_id:int,min_id:int,limit:int,events_filter:"raw.base.ChannelAdminLogEventsFilter"=None,admins:Optional[List["raw.base.InputUser"]]=None)->None:self.channel=channel# InputChannelself.q=q# stringself.max_id=max_id# longself.min_id=min_id# longself.limit=limit# intself.events_filter=events_filter# flags.0?ChannelAdminLogEventsFilterself.admins=admins# flags.1?Vector<InputUser>@staticmethoddefread(b:BytesIO,*args:Any)->"GetAdminLog":flags=Int.read(b)channel=TLObject.read(b)q=String.read(b)events_filter=TLObject.read(b)ifflags&(1<<0)elseNoneadmins=TLObject.read(b)ifflags&(1<<1)else[]max_id=Long.read(b)min_id=Long.read(b)limit=Int.read(b)returnGetAdminLog(channel=channel,q=q,max_id=max_id,min_id=min_id,limit=limit,events_filter=events_filter,admins=admins)defwrite(self,*args)->bytes:b=BytesIO()b.write(Int(self.ID,False))flags=0flags|=(1<<0)ifself.events_filterisnotNoneelse0flags|=(1<<1)ifself.adminselse0b.write(Int(flags))b.write(self.channel.write())b.write(String(self.q))ifself.events_filterisnotNone:b.write(self.events_filter.write())ifself.adminsisnotNone:b.write(Vector(self.admins))b.write(Long(self.max_id))b.write(Long(self.min_id))b.write(Int(self.limit))returnb.getvalue()