OneBot icon

OneBot

Consume OneBot API

Overview

This node integrates with the OneBot API to perform various messaging and group management operations related to a QQ bot. Specifically, for the "消息" (Message) resource and the "发送私聊消息" (Send private message) operation, it allows sending private chat messages directly to a friend by specifying their user name or ID.

Common scenarios where this node is useful include:

  • Automating direct communication with individual users on QQ.
  • Sending notifications, alerts, or personalized messages to specific friends.
  • Integrating QQ private messaging into broader workflows, such as customer support or event reminders.

Example: Automatically send a private message to a user when a certain event occurs in your system, like a new order confirmation or a support ticket update.

Properties

Name Meaning
User Name or ID Select a friend by searching nickname or QQ number, or directly input the QQ number.
Message The content of the private message to send.
Forward Mode Boolean option indicating whether to forward multiple messages as a single forwarded message.

Output

The node outputs JSON data representing the response from the OneBot API after attempting the operation. For sending private messages, the output JSON typically contains success status and any returned data or error messages.

If an error occurs during execution, the output JSON includes an error field with the error message and a success field set to false.

No binary data output is involved in this operation.

Dependencies

  • Requires connection to a OneBot API endpoint with valid authentication credentials (an API key or token).
  • The node depends on n8n credentials configured for the OneBot API.
  • The node uses internal helper methods to make HTTP requests to the OneBot API.

Troubleshooting

  • Missing or invalid user ID: If the "User Name or ID" property is empty or incorrect, the node will fail to send the message. Ensure the user exists and the ID is correct.
  • API request failures: Network issues or invalid API credentials can cause errors. Verify the OneBot API endpoint and credentials are correctly configured.
  • Permission errors: The bot must have permission to send private messages to the specified user.
  • Error messages: The node logs errors with details. Common errors include missing required parameters or insufficient permissions. Review the error message in the output JSON for guidance.

Links and References

Discussion