Skip to content

changeChatMemberStatus

Sahri Riza Umami edited this page Mar 13, 2017 · 4 revisions

Changes status of the chat member, need appropriate privileges.

changeChatMemberStatus(chat_id, user_id, status)

In channel chats, user will be added to chat members if he is yet not a member and there is less than 200 members in the channel.
Status will not be changed until chat state will be synchronized with the server.
Status will not be changed if application is killed before it can send request to the server.

Option Description
chat_id Chat identifier.
user_id Identifier of the user to edit status, bots can be editors in the channel chats.
status New status of the member in the chat. The status are Creator, Editor, Moderator, Member, Left, and Kicked.

Example

  • 133780085 is creator of the chat, can delete any message, kick any user and add editors and moderators in channels.

    changeChatMemberStatus(1234567890, 133780085, 'Creator')
  • In broadcast channels, 133780085 can post messages to the broadcast channel and have moderator rights. In groups and supergroups, 133780085 can add new members to the chat/kick unpriviledged members.

    changeChatMemberStatus(1234567890, 133780085, 'Editor')
  • Only for channels, 133780085 can delete messages of unprivileged members and kick them.

    changeChatMemberStatus(1234567890, 133780085, 'Moderator')
  • User 133780085 is a member of 1234567890, but have no any additional privileges.

    changeChatMemberStatus(1234567890, 133780085, 'Member')
  • 133780085 is not a 1234567890 member.

    changeChatMemberStatus(1234567890, 133780085, 'Left')
  • 133780085 was kicked from the 1234567890 (and obviously is not a 1234567890 member).

    changeChatMemberStatus(1234567890, 133780085, 'Kicked')

Test script
Frequently Asked Questions
The Functions

Clone this wiki locally