Actions13
Overview
This node integrates with the OneBot API to manage group chat functionalities on a messaging platform. Specifically, for the "群组" (Group) resource and the "禁言群成员" (Ban Group Member) operation, it allows administrators or group owners to mute (ban from speaking) specific members within a managed group for a specified duration.
Typical use cases include:
- Temporarily muting disruptive members in a group chat.
- Automatically lifting bans after a set time.
- Managing group member permissions dynamically via automation workflows.
For example, an admin can configure this node to mute a member for 30 minutes if they post inappropriate content, helping maintain order without manual intervention.
Properties
| Name | Meaning |
|---|---|
| Group Name or ID | Select a group where you have management rights (group owner or admin). |
| Member Name or ID | Select the group member to mute/unmute by nickname or user ID. Only normal members can be selected. |
| Ban Duration (Seconds) | Duration of the mute in seconds; 0 means unmute (cancel ban). Default is 1800 seconds (30 minutes). |
Output
The node outputs JSON data representing the response from the OneBot API for the ban operation. The structure typically includes success status and any error messages if the operation failed.
Example output JSON structure:
[
{
"success": true,
"data": { /* details about the ban operation result */ }
}
]
If the operation fails, the output will contain an error message:
[
{
"error": "Error message describing the failure",
"success": false
}
]
No binary data output is involved in this operation.
Dependencies
- Requires an active connection to the OneBot API with valid authentication credentials (an API key or token).
- The bot must have administrative or ownership privileges in the target group to perform mute operations.
- The node uses internal API calls to fetch group lists and member information to validate permissions before executing the ban.
Troubleshooting
Common Issues:
- Attempting to mute a member without sufficient bot permissions (not an admin or owner) will cause errors.
- Providing invalid or empty group or user IDs will prevent the operation.
- Network or API request failures may interrupt execution.
Error Messages and Resolutions:
"无法执行操作: set_group_ban 需要管理员权限,当前机器人不是群 X 的管理员或群主"
Resolution: Ensure the bot has admin or owner rights in the specified group."执行操作时出错: 发送群消息需要有效的群ID,但未提供"
Resolution: Provide a valid group ID."获取登录信息失败,无法检查权限"
Resolution: Verify API credentials and connectivity to the OneBot service.
Links and References
- OneBot API Documentation (general reference for API endpoints)
- n8n documentation on creating custom nodes and using API credentials (for setup guidance)