banChatSenderChat
Ban a channel from sending messages in a chat.
Request
POST /:token/banchatsenderchat
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| chat_id | Integer/String | Yes | Unique identifier or username of the target chat |
| sender_chat_id | Integer | Yes | Unique identifier of the channel to be banned |
Response
Returns Boolean true on success.
json
{
"ok": true,
"result": true
}Error Codes
| Code | Description |
|---|---|
| 400 | Bad request parameters, such as missing chat_id or sender_chat_id |
| 401 | Invalid or expired token |
| 403 | Bot does not have administrator privileges or permission to ban channels |
| 404 | Chat or channel not found |
| 500 | Internal server error |
Example
cURL
bash
curl -X POST "https://api.example.com/<token>/banchatsenderchat" \
-H "Content-Type: application/json" \
-d '{
"chat_id": -1001234567890,
"sender_chat_id": -1009876543210
}'