OneBot icon

OneBot

Consume OneBot API

Overview

This node integrates with the OneBot API to manage and retrieve information about group chats and their members on a messaging platform. Specifically, for the "群组" (Group) resource and the "获取群成员信息" (Get Group Member Info) operation, it fetches detailed information about a specific member within a selected group.

Common scenarios where this node is beneficial include:

  • Automating group management tasks by retrieving member roles or statuses.
  • Building workflows that respond to group member data, such as sending targeted messages or adjusting permissions.
  • Monitoring group membership changes or verifying member identities.

Practical example:

  • A workflow that triggers when a new message arrives in a group, then uses this node to get the sender's member info to check if they are an admin before proceeding.

Properties

Name Meaning
Group Name or ID Select the target group by name or ID. You can search by group name or number. Required.
Member Name or ID Select the group member by nickname or QQ number, or enter QQ number directly. Required.

These properties allow you to specify exactly which group and which member's information you want to retrieve.

Output

The node outputs JSON data containing the detailed information of the specified group member. This typically includes fields such as the member's role (e.g., owner, admin, member), user ID, nickname, and other profile details provided by the OneBot API.

If an error occurs (e.g., invalid group or member ID), the output JSON will contain an error field with the error message and a success flag set to false.

No binary data output is involved in this operation.

Dependencies

  • Requires connection to a OneBot API endpoint with valid authentication credentials (an API key or token).
  • The node depends on the OneBot API methods like get_group_member_info and get_login_info.
  • Proper permissions: The bot must have sufficient rights in the target group to query member information.

Troubleshooting

  • Common issues:

    • Invalid or missing group ID: The node throws an error if the group ID is not provided or invalid.
    • Invalid or missing member ID: Similarly, an error occurs if the member ID is not provided or invalid.
    • Insufficient permissions: If the bot is not an admin or owner in the group, it may fail to retrieve member info.
    • API request failures due to network or authentication problems.
  • Error messages and resolutions:

    • "获取群成员信息需要有有效的群ID,但未提供" ("Getting group member info requires a valid group ID, but none was provided"): Ensure the group ID property is set correctly.
    • "获取群成员信息失败,无法获取权限" ("Failed to get group member info, unable to obtain permission"): Verify the bot's role in the group and its API credentials.
    • Network or timeout errors: Check connectivity and API endpoint availability.

Links and References

  • OneBot API Documentation
  • n8n documentation on creating custom nodes and using API credentials
  • Messaging platform official docs for group and member management APIs (depending on your platform)

This summary focuses on the "群组" resource and the "获取群成员信息" operation, describing how to use the node to retrieve detailed information about a group member via the OneBot API.

Discussion