BaleMessenger icon

BaleMessenger

Interact with Bale Messenger API

Overview

The "Delete Chat Message" operation of the BaleMessenger node allows users to delete a specific message from a chat by providing the unique identifiers for both the chat and the message. This is useful in scenarios where messages need to be removed due to errors, outdated information, or moderation purposes.

Practical examples include:

  • Automatically deleting bot-generated messages after a certain time.
  • Removing inappropriate or sensitive content from group chats.
  • Cleaning up chat history programmatically based on user actions or triggers.

Properties

Name Meaning
Chat ID Unique identifier for the target chat where the message to delete exists.
Message ID Unique identifier of the message to delete within the specified chat.

Output

The output JSON contains a single field indicating the success of the deletion:

{
  "messageDeleted": true
}

This confirms that the message was successfully deleted. There is no binary data output for 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) and axios for HTTP requests.

Troubleshooting

  • Common issues:

    • Invalid or missing Chat ID or Message ID will cause the deletion to fail.
    • Insufficient permissions for the bot to delete messages in the target chat.
    • Network or API errors when communicating with the Bale Messenger service.
  • Error messages:

    • Errors thrown by the underlying API call may include details about authorization failures or invalid parameters.
    • If the message does not exist or has already been deleted, the API might return an error indicating so.
  • Resolution tips:

    • Verify that the Chat ID and Message ID are correct and correspond to existing entities.
    • Ensure the bot has appropriate rights to delete messages in the chat.
    • Check network connectivity and API credentials validity.

Links and References

Discussion