banChatMember

Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

Arguments
Name Type Description Required
chat_id int | string | null | array Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername) no
user_id int | null Unique identifier of the target user no
until_date int | null Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only. no
revoke_messages bool | null Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels. no
token string | null You can use this method on another bot with specify this parameter no
forgot bool | null You can set to not receive request result, dont set it or pass null for turn it off no
answer bool | null You can set to answer to webhook, dont set it or pass null for turn it off no

Output : bool | BPT\types\responseError

Static or normal : Static

Examples :

request::banChatMember(chat_id: int | string | null, user_id: int | null, until_date: int | null, revoke_messages: bool | null, token: String | null, forgot: Boolean | null, answer: Boolean | null);
request::banChatMember(['chat_id' => int | string | null, 'user_id' => int | null, 'until_date' => int | null, 'revoke_messages' => bool | null, 'token' => String | null, 'forgot' => Boolean | null, 'answer' => Boolean | null]);
request::banChatMember();