Actions19
Overview
This node integrates with the OneBot API to send private chat messages to specified users. It supports sending plain text messages, images (from URLs, local files, or Base64 encoding), and forwarding multiple messages in a structured forward message format. The node is useful for automating direct communication with friends or contacts on platforms supported by OneBot, such as QQ bots.
Common scenarios:
- Sending automated notifications or alerts directly to a user.
- Delivering multimedia content like images privately.
- Forwarding chat histories or multiple messages in a clean, consolidated format.
- Customizing sender information when forwarding messages to simulate different senders.
Practical example:
- A bot that sends a daily summary report as a private message with an attached image.
- Forwarding a series of customer support chat logs to a user in a single forwarded message card.
- Sending a personalized greeting with a custom nickname shown as the sender.
Properties
| Name | Meaning |
|---|---|
| User Name or ID | Select the recipient user from a list of friends or specify their ID via expression. This is the target user who will receive the private message. |
| Message | The text content of the private message to send. Supports multiline input. |
| 转发模式 (Forward Mode) | Boolean flag indicating whether to use the forward message format for sending multiple messages. When enabled, messages are sent as a consolidated forward message card. |
| 转发消息设置 (Forward Settings) | Configuration for the appearance of the forward message card, including: - 消息摘要 (Summary): Title at the top of the card. - 消息来源 (Source): Text shown at the top-right corner. - 提示文字 (Prompt): Text at the bottom. - 文本内容 (News): Text content inside the forwarded message. |
| 自定义发送者信息 (Custom Sender) | Boolean flag to customize sender information for each message in the forward message. |
| 发送者信息 (Sender Info) | When custom sender is enabled, configure: - 用户ID (User ID): Displayed sender's user ID (defaults to bot's ID if empty). - 昵称 (Nickname): Displayed sender's nickname (defaults to bot's nickname if empty). |
| 发送图片 (Send Image) | Boolean flag to indicate whether to send an image along with the message. |
| 图片来源 (Image Source) | Source type of the image: - 网络图片 (URL) - 本地图片 (Local file path) - Base64编码 (Base64 encoded string) |
| 图片URL (Image URL) | URL address of the image to send (used if Image Source is URL). |
| 本地图片路径 (Image Path) | Full local file path of the image to send (used if Image Source is local file). |
| Base64编码图片 (Image Base64) | Base64 encoded string of the image (without data URI prefix), used if Image Source is Base64. |
Output
The node outputs JSON data representing the result of the send operation. Typically, this includes success status and any response data returned by the OneBot API.
If forwarding multiple messages, the output reflects the combined forward message structure.
If sending images, the output confirms the successful transmission of the image message.
No binary data output is produced by this node; all outputs are JSON objects describing the operation results.
Dependencies
- Requires a configured API key credential for authenticating with the OneBot API.
- The node depends on the OneBot API being accessible and properly configured to allow sending private messages.
- Uses internal helper methods to load friend lists and other dynamic options.
- No additional external services beyond OneBot API are required.
Troubleshooting
Common issues:
- Failure to send messages due to invalid or missing user ID.
- Errors when sending images if the image URL is unreachable or local file path is incorrect.
- Forward mode errors if the message array is malformed or empty.
- Authentication failures if the API key credential is not set or expired.
Error messages and resolutions:
"Unknown resource type": Check that the resource parameter is correctly set to "message"."Failed to get friend list": Ensure the API key has permission and the OneBot API is reachable."Execution error during operation": Review the node parameters for correctness, especially user IDs and message content.- Image sending errors: Verify the image source and path/URL validity.
Links and References
- OneBot API Documentation
- n8n Expressions Documentation
- OneBot Forward Message Format (for understanding forward_mode usage)