version: 2.1.3
unbanChatMember
Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only_if_banned. Returns True on success.
Parameters
chat_id | int | string | Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername) | Optional |
user_id | int | Unique identifier of the target user | Optional |
only_if_banned | bool | Do nothing if the user is not banned | 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
ErrorName | description |
---|---|
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->unbanChatMember(['chat_id' => int | string, 'user_id' => int, 'only_if_banned' => bool]);
$this->unbanChatMember();
Method alices
kick
unbanchatmember
unban