BaleMessenger icon

BaleMessenger

Interact with Bale Messenger API

Overview

The node integrates with the Bale Messenger API to send various types of messages and perform message-related operations within chats. Specifically, for the Message resource and Send Message operation, it sends text messages to a specified chat. This is useful in automating communication workflows such as sending notifications, alerts, or conversational messages to users or groups on Bale Messenger.

Practical examples include:

  • Sending a welcome message to new chat members.
  • Broadcasting updates or announcements to a group.
  • Responding automatically to user inputs with predefined text messages.

Properties

Name Meaning
Chat ID Unique identifier for the target chat where the message will be sent.
Text The text content of the message to be sent.
Reply Markup Additional interface options for the message's keyboard or reply interface. Options include:
- Inline Keyboard: Buttons displayed next to the message.
- Reply Keyboard: Custom keyboard with reply options.
- Reply Keyboard Remove: Removes custom keyboard.
- None: No additional interface.
Inline Keyboard Defines rows and buttons for an inline keyboard that appears next to the message. Each button can have:
- Text label
- Callback data (sent when pressed)
- URL to open when pressed.
Reply Keyboard Defines rows and buttons for a custom reply keyboard. Each button has a text label which can be sent as a message when pressed.
Reply Keyboard Remove Options to remove the custom keyboard, including whether to remove it selectively for specific users.
Reply To Message ID If the message is a reply, this is the ID of the original message being replied to.

Output

The output JSON contains the response from the Bale Messenger API after sending the message. It typically includes details about the sent message such as message ID, chat ID, date, and the message content itself.

No binary data is output by this operation.

Example output structure (simplified):

{
  "message_id": 123,
  "chat": {
    "id": "chatId",
    "type": "group"
  },
  "date": 1610000000,
  "text": "Your sent message text"
}

Dependencies

  • Requires an active Bale Messenger API token credential configured in n8n.
  • Uses the official Bale Messenger Bot API endpoint (https://tapi.bale.ai/bot).
  • Relies on the node-telegram-bot-api library internally adapted for Bale Messenger compatibility.
  • No additional environment variables are required beyond the API token credential.

Troubleshooting

  • Invalid Chat ID: If the chat ID is incorrect or the bot is not a member of the chat, the API call will fail. Verify the chat ID and bot permissions.
  • Missing Required Fields: The "Text" and "Chat ID" fields are mandatory. Omitting them will cause errors.
  • Reply Markup Misconfiguration: Incorrectly structured inline or reply keyboards may cause the message sending to fail. Ensure buttons and rows are properly defined.
  • API Token Issues: Invalid or expired API tokens will result in authentication errors. Refresh or reconfigure the API credentials.
  • Network Errors: Connectivity issues to the Bale Messenger API endpoint can cause failures. Check network access and proxy settings if applicable.

Common error messages usually come from the Bale API and indicate issues like invalid parameters, unauthorized access, or malformed requests. Reviewing the error details returned by the API helps pinpoint the problem.

Links and References


This summary focuses on the Message resource and Send Message operation as requested, based on static analysis of the provided source code and property definitions.

Discussion