version: 2.1.3







restrictChatMember

Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success.

Parameters

chat_id int | string Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) Optional
user_id int Unique identifier of the target user Optional
permissions ChatPermissions A JSON-serialized object for new user permissions Yes
until_date int Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever 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->restrictChatMember(['chat_id' => int | string, 'user_id' => int, 'permissions' => ChatPermissions, 'until_date' => int]);
$this->restrictChatMember(['permissions' => ChatPermissions]);

Method alices

Method output :

bool