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 specific user from a Telegram chat, optionally setting a ban expiration and removing the user's messages from the chat.

Inputs

  • Chat ID (required) — Unique identifier for the target chat or username (@channelusername).
  • User ID (required) — Unique identifier of the user to ban from the chat.
  • Until Date — Unix timestamp when the user will be unbanned (0 means the ban is permanent).
  • Revoke Messages — Boolean flag indicating whether to delete all messages from the chat for the banned user.

Output shape

a single JSON object representing the Telegram API response of the banChatMember call

The operation returns the API's result object directly as JSON. It may include information about success or failure of the ban action.

Examples

Example 1: Ban a user from a chat indefinitely and remove their messages

Set the Chat ID and User ID, leave Until Date as 0 (default), set Revoke Messages to true.

Links

Discussion