channels.getAdminLog

Get the admin log of a channel/supergroup

Example

const {Api, TelegramClient} = require('telegram');
const {StringSession} = require('telegram/sessions');

const session = new StringSession('');
const client = new TelegramClient(session, apiId, apiHash, {});

(async function run() {
    const result = await client.invoke(new Api.channels.getAdminLog({
        channel: new Api.InputChannel({...}),
        q: 'random string here',
        eventsFilter: new Api.ChannelAdminLogEventsFilter({...}),
        admins: [new Api.InputUser({...})],
        maxId: 9964589,
        minId: 9259142,
        limit: 2782051,
        }));
    console.log(result); // prints the result
})();

TL schema

channels.adminLogResults#ed8af74d events:Vector<ChannelAdminLogEvent> chats:Vector<Chat> users:Vector<User> = channels.AdminLogResults;
---functions---
channels.getAdminLog#33ddf480 flags:# channel:InputChannel q:string events_filter:flags.0?ChannelAdminLogEventsFilter admins:flags.1?Vector<InputUser> max_id:long min_id:long limit:int = channels.AdminLogResults;

Parameters

Name

Type

Description

flags

channel

Channel

q

Search query, can be empty

events_filter

Event filter

admins

Only show events from these admins

max_id

Maximum ID of message to return (see pagination)

min_id

Minimum ID of message to return (see pagination)

limit

Maximum number of results to return, see pagination

Result

channels.AdminLogResults

Possible errors

Code

Type

Description

400

CHANNEL_INVALID

The provided channel is invalid

400

CHANNEL_PRIVATE

You haven't joined this channel/supergroup

400

CHAT_ADMIN_REQUIRED

You must be an admin in this chat to do this

403

CHAT_WRITE_FORBIDDEN

You can't write in this chat

400

MSG_ID_INVALID

Invalid message ID provided

Can bots use this methd ?

yes

How to fetch results from large lists of objects.

How to handle channels, supergroups, groups, and what's the difference between them.

Last updated