OneBot icon

OneBot

Consume OneBot API

Overview

This node integrates with the OneBot API to perform various operations related to a QQ bot, including managing friends, groups, and messages. Specifically, for the resource "好友" (Friend) and operation "给好友点赞" (Send Like to Friend), it allows users to send likes to a selected friend a specified number of times. This is useful in scenarios where you want to automate appreciation or interaction with friends on QQ, such as sending daily likes to close contacts or automating social engagement.

Practical example:

  • Automatically send a like to a friend once per day to maintain good relations.
  • Send multiple likes to a friend during special occasions or events.

Properties

Name Meaning
User Name or ID Select a friend by nickname or QQ number; supports searching or direct QQ number input.
Times Number of likes to send; non-SVIP users can only send up to 10 likes per day.

Output

The node outputs JSON data representing the response from the OneBot API after performing the "send_like" operation. The structure typically includes success status and any relevant data returned by the API. If an error occurs, the output JSON contains an error field with the error message and a success field set to false.

No binary data output is involved in this operation.

Example output JSON snippet:

[
  {
    "success": true,
    "data": { /* API response details */ }
  }
]

or in case of error:

[
  {
    "json": {
      "error": "Error message here",
      "success": false
    }
  }
]

Dependencies

  • Requires connection to a OneBot-compatible QQ bot API endpoint.
  • Needs an API key or authentication token configured in n8n credentials to authorize requests.
  • Uses internal methods to fetch friend lists dynamically for user selection.

Troubleshooting

  • Common issues:

    • Exceeding the daily like limit for non-SVIP users (max 10 times).
    • Invalid or missing friend ID or nickname causing failure to identify the target friend.
    • Network or API errors when communicating with the OneBot server.
  • Error messages and resolutions:

    • "Invalid friend ID": Ensure the friend is correctly selected or entered.
    • "Daily like limit exceeded": Reduce the "Times" value or wait until the next day.
    • "Failed to get friend list": Check API connectivity and credentials.
    • Permission-related errors if the bot lacks rights to perform actions on the friend.

Links and References


This summary focuses on the "好友" resource and "给好友点赞" operation based on the provided source code and property definitions.

Discussion