Actions19
Overview
This node interacts with the OneBot API to manage group-related operations, specifically allowing users to set or unset group administrators. It is useful in scenarios where a group owner needs to delegate administrative privileges to certain members for better group management. For example, a community manager can use this node to promote trusted members as admins to help moderate discussions or manage group settings.
Properties
| Name | Meaning |
|---|---|
| Group Name or ID | Select the target group from a list of groups you own or specify its ID using an expression. |
| 成员 Names or IDs | Select one or more group members by name or ID to be set or unset as administrators. |
| Enable Admin | Boolean flag indicating whether to set (true) or unset (false) the selected members as group admins. Only the group owner can perform this action. |
Output
The node outputs JSON data representing the result of the operation. The output typically includes success status and any error messages if the operation fails. The structure is an array of JSON objects corresponding to each input item processed. There is no binary data output for this operation.
Example output JSON snippet:
{
"success": true,
"message": "Group admin(s) updated successfully"
}
or on failure:
{
"success": false,
"error": "Only the group owner can set or unset admins"
}
Dependencies
- Requires connection to a OneBot API endpoint.
- Needs an API key credential configured in n8n to authenticate requests.
- The user must have ownership rights of the group to set or unset admins.
- The node uses internal helper methods to fetch owned groups and group members dynamically for selection options.
Troubleshooting
Common issues:
- Attempting to set or unset admins without being the group owner will fail.
- Providing invalid group IDs or member IDs may cause errors.
- Network or authentication failures with the OneBot API will prevent successful execution.
Error messages and resolutions:
"Only the group owner can set or unset admins": Ensure your API credentials correspond to the group owner account."Failed to retrieve login info"or"Failed to retrieve group list": Check API connectivity and credentials."No managed groups found": Confirm that the authenticated user owns or manages the specified group.
Links and References
- OneBot API Documentation
- n8n Expressions Documentation (for dynamic property values)