Actions6
- Friend Actions
- Group Actions
- Message Actions
Overview
This node integrates with the OneBot API, enabling users to interact with various bot-related resources such as friends, groups, messages, and miscellaneous bot information. Specifically, for the Friend resource and the Get Stranger Info operation, the node fetches detailed information about a user who is not necessarily in the friend list but can be identified by their user ID or username.
Common scenarios where this node is beneficial include:
- Retrieving profile details of unknown users interacting with your bot.
- Gathering additional context about users before sending messages or taking automated actions.
- Enriching workflows that require user metadata from the OneBot platform.
For example, you might use this node to get stranger info when a new user sends a message to your bot, allowing you to personalize responses based on their profile data.
Properties
| Name | Meaning |
|---|---|
| User Name or ID | Select a user from the loaded friend list or specify a user ID directly (supports expressions). This identifies the stranger whose info will be retrieved. |
Output
The node outputs JSON data containing the response from the OneBot API corresponding to the requested operation. For the Get Stranger Info operation, the output JSON includes detailed information about the specified user, such as their nickname, user ID, and other profile attributes provided by the OneBot API.
No binary data output is produced by this operation.
Dependencies
- Requires an active connection to the OneBot API via an API key credential configured in n8n.
- The node depends on internal helper functions (
apiRequest) to communicate with the OneBot API endpoints. - The
getFriendListmethod is used to dynamically load user options for the "User Name or ID" property.
Troubleshooting
- Empty or invalid user ID: If the "User Name or ID" property is left empty or contains an invalid value, the API request may fail or return no data. Ensure the user ID is correct or selected from the list.
- API authentication errors: If the API key credential is missing or invalid, requests will fail. Verify that the OneBot API credentials are correctly set up in n8n.
- Network or connectivity issues: Failures to reach the OneBot API endpoint will cause errors. Check network connectivity and API availability.
- Unsupported operations or resource mismatches: Selecting an operation not supported for the chosen resource may lead to unexpected behavior. Confirm that "Get Stranger Info" is selected under the "Friend" resource.
Links and References
- OneBot API Documentation (general reference for API endpoints)
- n8n Expressions Documentation (for using expressions in properties)