Actions2
- 消息相关 (Message) Actions
Overview
This node integrates with the NapCat QQ Bot API to send group chat messages. It allows users to send either text or image messages to a specified QQ group. This functionality is useful for automating group communications, such as broadcasting announcements, sharing images, or sending alerts within QQ groups.
Practical examples include:
- Sending daily updates or reminders to a team group.
- Sharing promotional images or event flyers in community groups.
- Automating responses or notifications triggered by other workflows.
Properties
| Name | Meaning |
|---|---|
| Group ID | The target QQ group ID where the message will be sent. |
| Message Type | The type of message to send. Options: Text, Image. |
| Message Content | The content of the text message (used only if Message Type is Text). |
| Image URL | The URL or base64 data of the image to send (used only if Message Type is Image). |
Output
The node outputs a JSON object containing the response from the NapCat API after attempting to send the group message. This typically includes information about the success or failure of the request and any relevant metadata returned by the API.
If an error occurs and "Continue On Fail" is enabled, the output JSON will contain an error field with the error message.
The node does not output binary data.
Dependencies
- Requires an API key credential for authenticating with the NapCat QQ Bot API.
- The node uses HTTP POST requests to the NapCat API endpoints
/send_group_msg. - The base URL for the API and authentication headers must be configured in the node credentials.
Troubleshooting
- Invalid Group ID: If the group ID is incorrect or the bot is not a member of the group, the API call will fail. Verify the group ID and bot permissions.
- Message Content Missing: For text messages, ensure that the "Message Content" property is not empty.
- Image URL Invalid: For image messages, ensure the "Image URL" is a valid URL or properly formatted base64 string.
- Authentication Errors: Ensure the API key credential is correctly set up and has necessary permissions.
- API Rate Limits: Frequent message sending may hit rate limits imposed by the API; consider adding delays or handling errors gracefully.
Common error messages are returned from the API and included in the output JSON under the error field when "Continue On Fail" is enabled.
Links and References
- NapCat QQ Bot API Documentation (official API docs)
- n8n documentation on HTTP Request Authentication