Actions32
- Bot Actions
- Callback Actions
- Chat Actions
- File Actions
- Message Actions
- Payment Actions
- Sticker Actions
Overview
The "Leave Chat" operation in the BaleMessenger node allows the bot to leave a group, supergroup, or channel chat on the Bale Messenger platform. This is useful when you want your bot to exit a chat it was previously part of, for example, after completing a task or when no longer needed in that conversation.
Practical scenarios include:
- Automatically leaving a support group after resolving an issue.
- Exiting channels where the bot's participation is no longer required.
- Managing bot presence dynamically based on workflow conditions.
Properties
| Name | Meaning |
|---|---|
| Chat ID | Unique identifier for the target chat from which the bot should leave (required). |
Output
The output JSON contains a single field:
leaved: A boolean indicating whether the bot successfully left the chat (trueif successful).
Example output:
{
"leaved": true
}
No binary data is produced by this operation.
Dependencies
- Requires an API authentication token credential for Bale Messenger.
- Uses the Bale Messenger Bot API endpoint at
https://tapi.bale.ai/bot. - The node depends on the official Bale Messenger Node.js SDK or API client wrapped inside the node implementation.
Troubleshooting
- Invalid Chat ID: If the provided Chat ID does not exist or the bot is not a member, the operation may fail. Verify the Chat ID is correct and the bot has joined the chat before attempting to leave.
- Insufficient Permissions: The bot must have permission to leave the chat. If permissions are restricted, the API call will fail.
- API Errors: Network issues or invalid credentials can cause errors. Ensure the API token is valid and the network connection is stable.
- Error Messages: The node may throw errors related to failed API requests. Check the error message details for clues, such as "chat not found" or "unauthorized".
Links and References
- Bale Messenger Bot API Documentation (general reference for API methods)
- n8n documentation on creating and using custom nodes (for understanding node structure and credentials)