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.
func (c *Client) ChannelsGetAdminedPublicChannels(ctx context.Context, request *ChannelsGetAdminedPublicChannelsRequest) (MessagesChatsClass, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.ChannelsGetAdminedPublicChannels(ctx, &tg.ChannelsGetAdminedPublicChannelsRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // MessagesChatsClass
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
ByLocation | bool | — | Get geogroups |
CheckLimit | bool | — | 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. |
ForPersonal | bool | — | Set this flag to only fetch the full list of channels that may be passed to account updatePersonalChannel to display them on our profile page. |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | CHANNELS_ADMIN_LOCATED_TOO_MUCH | The user has reached the limit of public geogroups. |
| 400 | CHANNELS_ADMIN_PUBLIC_TOO_MUCH | You're admin of too many public channels, make some channels private to change the username of this channel. |
References
- Official documentation
- Generated Go reference
- TL definition:
channels.getAdminedPublicChannels#f8b036af