version: 2.1.3







promoteChatMember

Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success.

Parameters

chat_id int | string Unique identifier for the target chat or username of the target channel (in the format @channelusername) Optional
user_id int Unique identifier of the target user Optional
is_anonymous bool Pass True, if the administrator's presence in the chat is hidden Optional
can_manage_chat bool Pass True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege Optional
can_post_messages bool Pass True, if the administrator can create channel posts, channels only Optional
can_edit_messages bool Pass True, if the administrator can edit messages of other users and can pin messages, channels only Optional
can_delete_messages bool Pass True, if the administrator can delete messages of other users Optional
can_manage_video_chats bool Pass True, if the administrator can manage video chats Optional
can_restrict_members bool Pass True, if the administrator can restrict, ban or unban chat members Optional
can_promote_members bool Pass True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him) Optional
can_change_info bool Pass True, if the administrator can change chat title, photo and other settings Optional
can_invite_users bool Pass True, if the administrator can invite new users to the chat Optional
can_pin_messages bool Pass True, if the administrator can pin messages, supergroups only Optional
token String You can use this method on another bot with specify this parameter Optional
return_array Boolean Specify the result type , if pass true results will be array otherwise will be object Optional
forgot Boolean You can set to not receive request result, dont set it or pass null for turn it off Optional
answer Boolean You can set to answer to webhook, dont set it or pass null for turn it off Optional

Method errors

ErrorNamedescription
required parameters not found required parameter for this method is not founded. you can see them in log
answer mode not allowed you can use answer mode only once for each webhook update and you already did
answer mode not allowed bc multi you can't use answer mode when multi is on

Method examples

$this->promoteChatMember(['chat_id' => int | string, 'user_id' => int, 'is_anonymous' => bool, 'can_manage_chat' => bool, 'can_post_messages' => bool, 'can_edit_messages' => bool, 'can_delete_messages' => bool, 'can_manage_video_chats' => bool, 'can_restrict_members' => bool, 'can_promote_members' => bool, 'can_change_info' => bool, 'can_invite_users' => bool, 'can_pin_messages' => bool]);
$this->promoteChatMember();

Method alices

Method output :

bool