channels.getAdminedPublicChannels

Get channels/supergroups/geogroups we're admin in. Usually called when the user exceeds the limit for owned public channels/supergroups/geogroups, and the user is given the choice to remove one of his channels/supergroups/geogroups.

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.getAdminedPublicChannels({
        byLocation: true,
        checkLimit: true,
        }));
    console.log(result); // prints the result
})();

TL schema

messages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;
messages.chatsSlice#9cd81144 count:int chats:Vector<Chat> = messages.Chats;
---functions---
channels.getAdminedPublicChannels#f8b036af flags:# by_location:flags.0?true check_limit:flags.1?true = messages.Chats;

Parameters

Name

Type

Description

flags

by_location

Get geogroups

check_limit

If set and the user has reached the limit of owned public channels/supergroups/geogroups, instead of returning the channel list one of the specified errors will be returned.

Useful to check if a new public channel can indeed be created, even before asking the user to enter a channel username to use in channels.checkUsername/channels.updateUsername.|

Result

messages.Chats

Possible errors

Code

Type

Description

400

CHANNELS_ADMIN_LOCATED_TOO_MUCH

Returned if both the check_limit and the by_location flags are set and the user has reached the limit of public geogroups

400

CHANNELS_ADMIN_PUBLIC_TOO_MUCH

Returned if the check_limit flag is set and the user has reached the limit of public channels/supergroups

Can bots use this methd ?

yes

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

Check if a username is free and can be assigned to a channel/supergroup

Change the username of a supergroup/channel

Current configuration

Last updated