Telegram Bot icon

Telegram Bot

Interact with the Telegram Bot API – send messages, manage chats, handle payments, and more

Actions101

Chat → Ban Chat Member

AI-generated

Summary

Ban a chat member

Inputs

  • chat_id (required) — Unique identifier for the target chat or username (e.g., @channelusername)
  • user_id (required) — Unique identifier of the user to ban
  • banAdditionalFields — Optional fields specific to ban: until_date (Unix timestamp) and revoke_messages (boolean)

Output shape

Telegram API response object

On success the response contains ok:true and result with ban details; errors propagate as exceptions. The shape is unchanged from the raw Telegram API response.

Examples

Example 1: Ban a user from a group chat

chat_id = '@mygroup', user_id = 123456789, banAdditionalFields = { until_date: 0, revoke_messages: true }

Links

Discussion