Closed phj233 closed 4 months ago
在本地使用 LLOneBot 进行测试时并未复现此问题。
发送文本:
val message = OneBotForwardNode.Factory.create(
bot.userId,
"BOT",
listOf(
OneBotText.create("喵")
)
)
event.content().send(message.toElement())
带图片的:
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())
疑似是服务端的协议实现问题? 查看OneBot服务端是否有什么相关日志,或尝试更换一个 OneBot 服务端实现,看看是否有什么差异。
//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
字段导致的
OB服务端: Lagrange.OneBot simbot-core:4.3.0 simbot-component-onebot-v11-core:1.0.0 使用
OneBotForwardNode
构造转发消息并使用toElment()
包装为Message.Element
发送出来的是该消息类型暂不支持查看