BaleMessenger icon

BaleMessenger

Interact with Bale Messenger API

Overview

The "Ban Chat Member" operation in the BaleMessenger node allows you to ban a specific user from a chat by their user ID. This action restricts the banned user from participating in the chat, which is useful for moderating groups or channels to prevent spam, abuse, or unwanted behavior.

Common scenarios where this node is beneficial include:

  • Moderation bots that automatically ban users based on certain triggers or reports.
  • Administrative workflows where chat managers want to programmatically ban disruptive members.
  • Integration with external systems that detect malicious users and enforce bans in chats.

Example: Automatically banning a user who posts prohibited content by passing the chat's unique identifier and the user's ID to this node.

Properties

Name Meaning
Chat ID Unique identifier for the target chat where the member will be banned.
UserId Numeric identifier of the user to ban from the chat.

Output

The output JSON contains a single field:

  • banned: A boolean indicating whether the ban operation was successful (true) or not (false).

Example output:

{
  "banned": true
}

No binary data is produced by this operation.

Dependencies

  • Requires an API authentication token credential for Bale Messenger API access.
  • Uses the Bale Messenger Bot API endpoint at https://tapi.bale.ai/bot.
  • The node depends on the official node-telegram-bot-api library adapted for Bale Messenger.
  • No additional environment variables are required beyond the API credentials configured in n8n.

Troubleshooting

  • Invalid Chat ID or User ID: If either the chat ID or user ID is incorrect or does not exist, the API call may fail or return an error. Verify these IDs before running the node.
  • Insufficient Permissions: The bot must have appropriate admin rights in the chat to ban members. Lack of permissions will cause the operation to fail.
  • API Errors: Network issues or API downtime can cause errors. Check connectivity and Bale Messenger service status.
  • Error Messages: The node returns error details in the output if the ban fails, including messages from the API response. Use these messages to diagnose issues such as permission problems or invalid parameters.

Links and References


This summary focuses exclusively on the "Ban Chat Member" operation within the "Chat" resource of the BaleMessenger node as requested.

Discussion