Skip to content

feat: add support for sending files via OneBot V11 file API #6403

@rin259

Description

@rin259

Description

Currently, AstrBot's OneBot V11 adapter attempts to send files using / which doesn't properly support file sending. OneBot V11 provides dedicated APIs for file transmission:

    • Send private file to user
    • Send file to group

Expected Behavior

When using or in a message chain, the bot should:

  1. Use or for file messages
  2. Pass the file path or URL as parameter
  3. Pass the display name as parameter

Current Issue

The current implementation in treats File segments the same as regular messages and uses /, which doesn't properly handle file transmission.

Implementation Suggestion

Modify or create a separate handler for File segments to use the appropriate OneBot V11 file APIs:

This would be a significant improvement for users who need to transfer files through their QQ bots.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:platformThe bug / feature is about IM platform adapter, such as QQ, Lark, Telegram, WebChat and so on.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions