BaleMessenger icon

BaleMessenger

Interact with Bale Messenger API

Overview

This node operation allows you to answer inline queries sent from an inline bot in Bale Messenger. Inline queries are requests initiated by users typing a query in the chat input field that triggers your bot to provide dynamic content suggestions. The node sends back a list of results matching the user's query, enabling interactive and context-aware bot responses.

Common scenarios where this node is beneficial include:

  • Providing search results or product listings directly within the chat interface.
  • Offering quick replies or media options based on user input.
  • Creating interactive bots that respond with rich content like images, articles, or custom messages inline.

For example, a shopping bot can use this node to return a list of products matching the user's typed keywords, allowing users to select items without leaving the chat.

Properties

Name Meaning
Query ID Unique identifier for the answered inline query. This identifies which inline query the bot is responding to.
Results A JSON-serialized array of results for the inline query. Each result represents an item (e.g., article, photo, video) to be shown as a suggestion to the user. Must be valid JSON.
Additional Fields Optional extra parameters:
• Cache Time: Maximum time in seconds the client may cache the result.
• Show Alert: Whether to show an alert instead of a notification.
• Text: Notification text (0-200 chars).
• URL: URL to open on user client.

Output

The node outputs a JSON object indicating whether the answer to the inline query was successful. The structure is:

{
  "successful": true|false,
  "errorMessage": "string (if any error occurred)",
  "errorDetails": {}
}
  • successful: Boolean indicating if the request succeeded.
  • errorMessage and errorDetails: Present only if an error occurred during the operation.

No binary data output 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 node-telegram-bot-api library adapted for Bale Messenger API calls.
  • Proper configuration of the API token credential in n8n is necessary.

Troubleshooting

  • Invalid JSON in Results: If the Results property contains invalid JSON, the node will throw an error stating "The results parameter is not a valid JSON string." Ensure the JSON array is correctly formatted.
  • API Request Failures: Errors returned from the Bale Messenger API (e.g., network issues, invalid token) will cause the node to fail with detailed error messages logged. Verify API credentials and network connectivity.
  • Missing Required Parameters: The Query ID and Results fields are mandatory. Omitting them will cause validation errors.
  • Cache Time Misconfiguration: Setting an excessively high cache time might cause stale results to appear on the client side.

Links and References

Discussion