OneBot-api icon

OneBot-api

Consume OneBot API

Overview

This node interacts with the OneBot API to perform various operations related to groups, members, friends, bots, messages, and miscellaneous functions. Specifically, for the "群组" (Group) resource and the "获取群成员列表" (Get group member list) operation, it retrieves the list of members in a specified group.

Common scenarios where this node is beneficial include:

  • Managing group chats by fetching current members.
  • Automating group member data retrieval for analytics or moderation.
  • Integrating group member information into workflows for notifications or access control.

Practical example:

  • Automatically fetch the member list of a group when a new message arrives to check if a user is part of the group before sending targeted messages.

Properties

Name Meaning
Group Name or ID Select a group from the dropdown list or specify a group ID using an expression. This identifies the target group whose member list will be retrieved.

Output

The node outputs JSON data containing the list of group members. Each item in the output array represents a group member with their associated details as returned by the OneBot API. The exact structure depends on the API response but typically includes member IDs, roles, nicknames, and other relevant member information.

If the node supports binary data output (not indicated here), it would represent media or files related to the group or members, but for this operation, the output is purely JSON.

Dependencies

  • Requires connection to a OneBot API endpoint.
  • Needs an API key credential configured in n8n to authenticate requests.
  • Uses internal helper methods to load options dynamically (e.g., group lists).
  • Relies on the OneBot API's availability and correct permissions for the authenticated user/bot.

Troubleshooting

  • Common issues:

    • Failure to retrieve group list or member list due to insufficient permissions or invalid API credentials.
    • Errors when specifying group ID if the group does not exist or the bot is not a member.
    • Network or API downtime causing request failures.
  • Error messages and resolutions:

    • "Failed to get login info": Check that the API key credential is valid and the bot is online.
    • "Failed to get group list": Ensure the bot has permission to view groups and is connected.
    • "Failed to get group member info": Verify the group ID is correct and the bot has access to the group's member list.
    • General execution errors during operation calls: Review logs for detailed error messages and confirm all required parameters are set correctly.

Links and References

  • n8n Expressions Documentation
  • OneBot API official documentation (refer to your OneBot API provider)
  • n8n community forums and documentation for custom node development and troubleshooting

Discussion