Use this method to ban a chat member from accessing chat. On success, chatMember is returned with the status banned. A ban is a blacklist; the user will not be able to join chat again.
Field | Type | Required | Description |
method | String | Yes | "banChatMember" |
chat_id | String | Yes | Unique identifier for Group or Channel where the member belongs. |
user_id | String | Yes | Unique identifier for this user member. |
Requests
json{ "method": "banChatMember", "chat_id": "47447589641110235", "user_id": "741147524123577778" }
javaString chatId = "4522291356145774"; String userId = "7411475241235777"; api.banChatMember(chatId, userId);
javascriptlet chatId = "4522291356145774"; let userId = "7411475241235777"; api.banChatMember(chatId, userId);
pythonnapi.ban_chat_member("chatId", "userId")
Response
json{ "chatMember": { "member_since": 1718029851000, "privileges": [ "1", "4611686018427387904" ], "view": 0, "account_type": "email", "chat": { "id": "90090684491334028" }, "type": "Admin", "user": { "id": "90089586341121118" }, "status": "Active", "tags": null }, "method": "chatMember" }