simple-robot / simbot-component-onebot

一个Kotlin多平台的 OneBot SDK 实现,一个异步高效、Java 友好的 Simple Robot 组件库 ~ 🐱🐱🐱
https://simbot.forte.love/component-onebot.html
GNU Lesser General Public License v3.0
10 stars 3 forks source link

发送合并转发消息发送出来的是 该消息类型暂不支持查看 #68

Closed phj233 closed 3 months ago

phj233 commented 3 months ago

OB服务端: Lagrange.OneBot simbot-core:4.3.0 simbot-component-onebot-v11-core:1.0.0 使用 OneBotForwardNode 构造转发消息并使用 toElment() 包装为 Message.Element 发送出来的是 该消息类型暂不支持查看 image image image image

ForteScarlet commented 3 months ago

在本地使用 LLOneBot 进行测试时并未复现此问题。

发送文本:

val message = OneBotForwardNode.Factory.create(
    bot.userId,
    "BOT",
    listOf(
        OneBotText.create("喵")
    )
)

event.content().send(message.toElement())
手机视角 ![W4EI0BF@_0D KNX0ID$NR22_tmb](https://github.com/user-attachments/assets/28387cb3-fb3f-4678-a82a-a1fd72ad71af)
PC视角 ![image](https://github.com/user-attachments/assets/92689e7a-bab5-4b7d-9795-1e94b54d1deb)

带图片的:

val message = OneBotForwardNode.Factory.create(
    bot.userId,
    "BOT",
    listOf(
        OneBotText.create("喵"),
        OneBotImage.create(
            File("C:\\Users\\Administrator\\Desktop\\图\\JetBrains.png").toResource()
        ) {
            localFileToBase64 = true
        }
    )
)

event.content().send(message.toElement())
手机视角 ![T_N{0V56AMMYLS5A%_NFXLL](https://github.com/user-attachments/assets/aece2046-1002-4d65-a489-e9ed90213cba) ![UM5~C)JKDQ_7 5LON%}V~DN](https://github.com/user-attachments/assets/f41920bf-bf69-445a-872f-9fef38e90951)
PC视角 ![image](https://github.com/user-attachments/assets/54d449f2-2aa5-4859-9302-52ed0af78ae4) ![image](https://github.com/user-attachments/assets/3f486f97-f5da-4211-862f-22633de70b14)

疑似是服务端的协议实现问题? 查看OneBot服务端是否有什么相关日志,或尝试更换一个 OneBot 服务端实现,看看是否有什么差异。

phj233 commented 3 months ago
//lagrange
info: Lagrange.OneBot.Core.Network.Service.HttpService[3]
      Receive(Conn: 9d45aa0d-f9bd-4aca-8f71-579aba294b0f: {"action":"send_msg","params":{"message_type":"group","group_id":"261982336","message":[{"type":"node","data":{"user_id":"1920460866","nickname":"Any","content":[{"type":"image","data":{"file":"https://img3.saucenao.com/vpc/frame.php?expires=1722366000&auth=KIB-oGtMU7ZCMmcZ8uNf370kdF0&rsz=0&enc=aGVudGFpL0Jha3VueXV1IE1haWQgR2FyaS8yIC0gVm9sdW1lIDIgLSAjNjE3MDQwIChyYXcpKGNlbikubXA0LjI2MTgyLnppcA&sub=18748-75-781906.jpg"}},{"type":"text","data":{"text":"相似度: 41.16"}},{"type":"text","data":{"text":"\n标题: null"}},{"type":"text","data":{"text":"\n链接: [\"https://anidb.net/anime/6512\"] "}}]}}],"auto_escape":true}})

//napcat
收到http请求 /send_msg {"message_type":"group","group_id":"261982336","message":[{"type":"node","data":{"user_id":"1920460866","nickname":"Any","content":[{"type":"image","data":{"file":"https://img1.saucenao.com/res/pixiv/3947/manga/39476055_p24.jpg?auth=VYCkGvuwWZjGD_HcRt2fIg&exp=1722366000"}},{"type":"text","data":{"text":"相似度: 28.10"}},{"type":"text","data":{"text":"\n标题: 【腐向】ピアクリカレンダー(10月)"}},{"type":"text","data":{"text":"\n链接: [\"https://www.pixiv.net/member_illust.php?mode=medium&illust_id=39476055\"] "}}]}}],"auto_escape":true} 

日志如上,但是看不出什么差异 OB服务端换了 napcat 就能正常发送了,感觉是lagrange Node 字段导致的

image