OneBot-api icon

OneBot-api

Consume OneBot API

Overview

This node integrates with the OneBot API to send group messages in a chat group. It supports sending plain text messages, images (from URL, local file, or Base64), and forwarding multiple messages in a special forward message format. The node allows mentioning all members or specific members in the group message.

Typical use cases include:

  • Automating announcements or notifications to a group.
  • Sending multimedia content like images to a group.
  • Forwarding chat logs or multiple messages as a single forwarded message card.
  • Tagging all or specific members for attention in group chats.

For example, you can use this node to send a daily reminder image to a project group, or forward a series of messages from another source as a consolidated chat record.

Properties

Name Meaning
Group Name or ID Select the target group from a list or specify its ID via expression. This is required to identify which group to send the message to.
Message The text content of the message to send.
转发模式 (Forward Mode) Whether to send multiple messages using the forward message format (a special card-like message that groups multiple messages).
转发消息设置 (Forward Settings) When forward mode is enabled, configure the display of the forwarded message card: summary (title), source (top-right label), prompt (bottom hint), and news (text content inside the forwarded message).
自定义发送者信息 (Custom Sender) Whether to customize sender information for each message when forwarding multiple messages.
发送者信息 (Sender Info) When custom sender is enabled, configure the sender's user ID and nickname shown on the forwarded messages. If left empty, the bot's own info is used.
@全体成员 (At All) Whether to add an @all mention at the beginning of the message to notify all group members.
@特定成员 (At User) Whether to mention specific members in the message.
要@的成员 Name or ID When @specific members is enabled, select the member(s) to mention by name or ID from the group member list or via expression.
发送图片 (Send Image) Whether to send an image along with the message.
图片来源 (Image Source) The source type of the image: network URL, local file path, or Base64 encoded string.
图片URL (Image URL) The URL address of the image when the source is set to network URL.
本地图片路径 (Image Path) The full local file path of the image when the source is set to local file.
Base64编码图片 (Image Base64) The Base64 encoded string of the image data (without prefix) when the source is set to Base64.

Output

The node outputs JSON data representing the result of the send group message operation. The output typically includes success status and any returned data from the OneBot API call.

If images are sent, the node handles the image upload or reference accordingly but does not output binary data itself; the output remains JSON describing the operation result.

Dependencies

  • Requires connection to a OneBot API endpoint with valid authentication credentials (an API key or token).
  • The node depends on the OneBot API supporting group messaging features.
  • The node uses internal helper methods to load group lists and group member lists dynamically for property options.
  • No additional external services beyond OneBot API are required.

Troubleshooting

  • Common issues:

    • Invalid or missing group ID will cause the message sending to fail.
    • Incorrect image URL or inaccessible local image path will prevent image sending.
    • Using forward mode incorrectly without proper message formatting may cause errors.
    • Mentioning users who are not in the selected group will cause errors.
  • Error messages:

    • Errors related to "unable to get login info" indicate authentication or connectivity problems with the OneBot API.
    • "Failed to get group list" or "failed to get group member info" suggest permission issues or API endpoint problems.
    • Runtime errors during execution will be caught and output as error messages in the node output JSON.
  • Resolutions:

    • Verify API credentials and connectivity.
    • Ensure the group ID and member IDs are correct and accessible.
    • Check image URLs or paths for correctness and accessibility.
    • Use expressions carefully to dynamically specify IDs.

Links and References

Discussion