telegram api method · layer 229 · #9a98ad68

channels.editAdmin

usable by users and bots

Modify the admin rights of a user in a supergroup/channel.

definition

channels.editAdmin#9a98ad68 flags:# channel:InputChannel user_id:InputUser admin_rights:ChatAdminRights rank:flags.0?string = Updates;

parameters

nametypedescription
flags#
channelInputChannelThe supergroup/channel.
user_idInputUserThe ID of the user whose admin rights should be modified
admin_rightsChatAdminRightsThe admin rights
rankflags.0?stringIndicates the role (rank) of the admin in the group: just an arbitrary string

returns

Updates

errors (31)

codeerrordescription
400ADMIN_RANK_EMOJI_NOT_ALLOWEDAn admin rank cannot contain emojis.
400ADMIN_RANK_INVALIDThe specified admin rank is invalid.
400ADMINS_TOO_MUCHThere are too many admins.
400BOT_CHANNELS_NABots can't edit admin privileges.
400BOT_GROUPS_BLOCKEDThis bot can't be added to groups.
400BOTS_TOO_MUCHThere are too many bots in this chat/channel.
400BUSINESS_CONNECTION_NOT_ALLOWEDThis method was invoked over a business connection using invokeWithBusinessConnection, but either (1) we're a user, and users cannot invoke methods over a business connection; (2) we're a bot, but business mode was disabled in @botfather or (3); we're a bot, but this method cannot be invoked over a business connection.
400CHANNEL_INVALIDThe provided channel is invalid.
400CHANNEL_MONOFORUM_UNSUPPORTEDMonoforums do not support this feature.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400FRESH_CHANGE_ADMINS_FORBIDDENYou were just elected admin, you can't add or modify other admins yet.
400INPUT_USER_DEACTIVATEDThe specified user was deleted.
400MSG_ID_INVALIDInvalid message ID provided.
400PEER_ID_INVALIDThe provided peer id is invalid.
400USER_BLOCKEDUser blocked.
400USER_CREATORFor channels.editAdmin: you've tried to edit the admin rights of the owner, but you're not the owner; for channels.leaveChannel: you can't leave this channel, because you're its creator.
400USER_ID_INVALIDThe provided user ID is invalid.
400USER_KICKEDThis user was kicked from this supergroup/channel.
400USER_NOT_MUTUAL_CONTACTThe provided user is not a mutual contact.
400USERS_TOO_MUCHThe maximum number of users has been exceeded (to create a chat, for example).
401AUTH_KEY_UNREGISTEREDThe specified authorization key is not registered in the system (for example, a PFS temporary key has expired).
403CHAT_ADMIN_INVITE_REQUIREDYou do not have the rights to do this.
403CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
403CHAT_WRITE_FORBIDDENYou can't write in this chat.
403RIGHT_FORBIDDENYour admin rights do not allow you to do this.
403USER_CHANNELS_TOO_MUCHOne of the users you tried to add is already in too many channels/supergroups.
403USER_NOT_MUTUAL_CONTACTThe provided user is not a mutual contact.
403USER_PRIVACY_RESTRICTEDThe user's privacy settings do not allow you to do this.
403USER_RESTRICTEDYou're spamreported, you can't create channels or chats.
406FRESH_CHANGE_ADMINS_FORBIDDENYou were just elected admin, you can't add or modify other admins yet.

history

present in layers 46–229 · constructor id changed 4×

idlayers
#eb7611d046–67
#20b8821468–92
#70f893ba93–103
#d33c8902104–222
#9a98ad68223–229