llonebot / llonebot Goto Github PK
View Code? Open in Web Editor NEW使你的NTQQ支持OneBot11协议进行QQ机器人开发
Home Page: https://llonebot.github.io
License: MIT License
使你的NTQQ支持OneBot11协议进行QQ机器人开发
Home Page: https://llonebot.github.io
License: MIT License
LiteLoaderQQNT-main\data\LLOneBot目录下有多个账号的配置文件时,不会尝试上报消息,删除多余配置文件后正常工作
版本说明:
QQNT:9.9.7-21357 (64位)
LiteLoader:1.0.3
Chromium:120.0.6099.56
Electron:28.0.0
Node.js:18.18.2
LLAPI:1.3.1
操作:
POST http://192.168.10.101:3000/send_msg
发送数据:
{ "message_type": "group", "group_id": 701339984, "message": [ { "type": "text", "data": { "text": "哈喽!" } } ], "auto_escape": false }
响应数据:
{ "retcode": 0, "status": 0, "data": {}, "message": "发送成功" }
消息内容并没有发出,只是一直像这样转圈
一段时间后显示红色感叹号(发送失败)
日志信息:
2024/2/4 17:39:48 Fervent Tempo Δ(<botQQ>):"selfInfo {\"uid\":\"<myUID>\",\"qid\":\"\",\"uin\":\"<botQQ>\",\"avatarUrl\":\"\",\"nickName\":\"Fervent Tempo Δ\",\"bio\":\"叮!变成星星吧!\",\"sex\":\"female\",\"raw\":{\"uid\":\"<myUID>\",\"qid\":\"\",\"uin\":\"<botQQ>\",\"nick\":\"Fervent Tempo Δ\",\"remark\":\"\",\"longNick\":\"叮!变成星星吧!\",\"avatarUrl\":\"\",\"birthday_year\":2020,\"birthday_month\":6,\"birthday_day\":1,\"sex\":2,\"topTime\":\"0\",\"isBlock\":false,\"isMsgDisturb\":false,\"isSpecialCareOpen\":false,\"isSpecialCareZone\":false,\"ringId\":\"0\",\"status\":0,\"qidianMasterFlag\":0,\"qidianCrewFlag\":0,\"qidianCrewFlag2\":0,\"extStatus\":0,\"categoryId\":0,\"onlyChat\":false,\"qzoneNotWatch\":false,\"qzoneNotWatched\":false,\"vipFlag\":false,\"yearVipFlag\":false,\"svipFlag\":false,\"vipLevel\":1,\"isZPlanCoupleOpen\":false,\"zplanCoupleSceneId\":0,\"teenagerFlag\":0,\"studyFlag\":0}}" 2024/2/4 17:39:48 Fervent Tempo Δ(<botQQ>):"llonebot loaded" 2024/2/4 17:39:48 Fervent Tempo Δ(<botQQ>):"llonebot render start" 2024/2/4 17:39:48 Fervent Tempo Δ(<botQQ>):"发送消息API已注册" 2024/2/4 17:39:49 Fervent Tempo Δ(<botQQ>):"llonebot render onLoad" 2024/2/4 17:39:50 Fervent Tempo Δ(<botQQ>):"全部群成员获取完毕" 2024/2/4 17:39:52 Fervent Tempo Δ(<botQQ>):"llonebot render onLoad" 2024/2/4 17:40:31 Fervent Tempo Δ(<botQQ>):"setting window created" 2024/2/4 17:40:37 Fervent Tempo Δ(<botQQ>):"llonebot render onLoad" 2024/2/4 17:40:52 Fervent Tempo Δ(<botQQ>):"API receive post:{\"message_type\":\"private\",\"user_id\":<myQQ>,\"message\":[{\"type\":\"text\",\"data\":{\"text\":\"你好!\"}}],\"auto_escape\":false,\"action\":\"send_private_msg\"}" 2024/2/4 17:41:22 Fervent Tempo Δ(<botQQ>):"API receive post:{\"group_id\":<groupID>,\"message_type\":\"group\",\"message\":[{\"data\":{\"text\":\"帮助菜单\\n============\\n@我 <命令><参数>即可使用。\\n-发*话(文本):@我 来点*话\\n-发*话(语音):@我 来点语音*话\\n-复读机(语音):@我 复读:<内容>\\n-复读机(文本):@我 复读文本:<内容>\\n-随机图片:@我 来点二次元\\n-开空调:@我 开空调\\n-闭空调:@我 关空调\\n-设置温度:@我 设置温度<温度>\\n-查询温度:@我 查询温度\\n-帮助:@我 帮助\\n-帮助:@我 help\\n============\"},\"type\":\"text\"}],\"action\":\"send_group_msg\"}" 2024/2/4 17:41:24 Fervent Tempo Δ(<botQQ>):"新消息事件上传成功: http://192.168.10.101:8888/ {\"self\":{\"platform\":\"qq\",\"user_id\":\"<botQQ>\"},\"self_id\":\"<botQQ>\",\"time\":1707039682,\"type\":\"message\",\"post_type\":\"message\",\"message_type\":\"group\",\"detail_type\":\"group\",\"message_id\":\"7331679609204350391\",\"sub_type\":\"group\",\"message\":[{\"data\":{\"mention\":\"<botQQ>\",\"qq\":\"<botQQ>\"},\"type\":\"at\"},{\"data\":{\"text\":\" 帮助\"},\"type\":\"text\"}],\"raw_message\":\"\",\"font\":14,\"group_id\":\"<groupID>\",\"user_id\":\"<myQQ>\",\"sender\":{\"user_id\":\"<myQQ>\",\"nickname\":\"<myNickName>\",\"card\":\"万号之主\",\"role\":\"owner\"}}" 2024/2/4 17:43:16 Fervent Tempo Δ(<botQQ>):"API receive post:{\"group_id\":<groupID>,\"message_type\":\"group\",\"message\":[{\"data\":{\"text\":\"帮助菜单\\n============\\n@我 <命令><参数>即可使用。\\n-发*话(文本):@我 来点*话\\n-发*话(语音):@我 来点语音*话\\n-复读机(语音):@我 复读:<内容>\\n-复读机(文本):@我 复读文本:<内容>\\n-随机图片:@我 来点二次元\\n-开空调:@我 开空调\\n-闭空调:@我 关空调\\n-设置温度:@我 设置温度<温度>\\n-查询温度:@我 查询温度\\n-帮助:@我 帮助\\n-帮助:@我 help\\n============\"},\"type\":\"text\"}],\"action\":\"send_group_msg\"}" 2024/2/4 17:43:18 Fervent Tempo Δ(<botQQ>):"新消息事件上传成功: http://192.168.10.101:8888/ {\"self\":{\"platform\":\"qq\",\"user_id\":\"<botQQ>\"},\"self_id\":\"<botQQ>\",\"time\":1707039795,\"type\":\"message\",\"post_type\":\"message\",\"message_type\":\"group\",\"detail_type\":\"group\",\"message_id\":\"7331680089068021932\",\"sub_type\":\"group\",\"message\":[{\"data\":{\"mention\":\"<botQQ>\",\"qq\":\"<botQQ>\"},\"type\":\"at\"},{\"data\":{\"text\":\" 帮助\"},\"type\":\"text\"}],\"raw_message\":\"\",\"font\":14,\"group_id\":\"<groupID>\",\"user_id\":\"<myQQ>\",\"sender\":{\"user_id\":\"<myQQ>\",\"nickname\":\"<myNickName>\",\"card\":\"万号之主\",\"role\":\"owner\"}}" 2024/2/4 17:45:02 Fervent Tempo Δ(<botQQ>):"API receive post:{\"message_type\":\"group\",\"group_id\":<groupID>,\"message\":[{\"type\":\"text\",\"data\":{\"text\":\"哈喽!\"}}],\"auto_escape\":true,\"action\":\"send_group_msg\"}" 2024/2/4 17:45:54 Fervent Tempo Δ(<botQQ>):"setting window created" 2024/2/4 17:46:01 Fervent Tempo Δ(<botQQ>):"llonebot render onLoad" 2024/2/4 17:47:40 Fervent Tempo Δ(<botQQ>):"API receive post:{\"message_type\":\"group\",\"group_id\":<groupID>,\"message\":[{\"type\":\"text\",\"data\":{\"text\":\"哈喽!\"}}],\"auto_escape\":false,\"action\":\"send_group_msg\"}" 2024/2/4 17:49:07 Fervent Tempo Δ(<botQQ>):"setting window created" 2024/2/4 17:49:14 Fervent Tempo Δ(<botQQ>):"llonebot render onLoad" 2024/2/4 17:49:19 Fervent Tempo Δ(<botQQ>):"llonebot render onLoad" 2024/2/4 17:50:42 Fervent Tempo Δ(<botQQ>):"setting window created" 2024/2/4 17:50:49 Fervent Tempo Δ(<botQQ>):"llonebot render onLoad" 2024/2/4 17:53:43 Fervent Tempo Δ(<botQQ>):"llonebot render onLoad"
在对接koishi时出现问题,希望添加新的API支持
相关issue:koishijs/koishi-plugin-adapter-onebot#12
发现版本:v2.1.0
以下是一个有错误的私聊上报示例:
{
"self": {
"platform": "qq",
"user_id": ""
},
"self_id": "",
"time": 1706688891,
"type": "message",
"post_type": "message",
**"message_type": "friend",**
"detail_type": "friend",
"message_id": "",
"sub_type": "friend",
"message": [
{
"data": {
"text": "来啦来啦~\n下午好~\n今天的天气:\n气温:17.0~25.0℃\n目前气温: 22.4℃\n一小时内降水量:0.0mm\n湿度:79.0%\n气压:1010.0hPa\n目前风向:东南风\n风速:1.7\n风力等级:微风"
},
"type": "text"
}
],
"raw_message": "",
"font": 14,
"user_id": "",
"sender": {
"user_id": "",
"nickname": ""
}
}
感谢作者制作了这个插件, 很好用
如果能够让账号自己退出指定群聊就更好了
请教 @全体成员 的写法
接收@全体成员 消息为text类型,不知道如何发送
QQ版本:9
LLAPI版本:最新
LLOneBot版本:最新
调用LLoneBot的方式或者应用端(如postman直接调用,或NoneBot2、Koishi):python直接http请求
您安装LLOneBot的步骤:
BUG描述:那个弱弱的问一句有没有消息上报的例子, 我只能通过调API发消息, 不会接收消息, 如果有的话十分感谢qwq
复现步骤:
如题,用的tx云轻量 服务器1 部署bot,同时有公网ip和内网ip,
在同一内网的另一台 服务器2 测试发现在只能用公网ip访问 服务器1的api,而不能用内网ip访问
故想咨询是否有可选绑定ip的方法或其他解决办法?
希望能在消息事件上报中的图片内容增加上图片url,目前看到只有本地文件路径。对于跨设备的分享不太方便。感谢大佬
目前收到表情是这样的:
2024/2/18 14:04:29 傻fufu的(3380643076): 收到新消息 {"msgId":"7336818910017867029","msgRandom":"743031415","msgSeq":"66867","cntSeq":"0","chatType":2,"msgType":17,"subMsgType":8,"sendType":0,"senderUid":"u_XR0B9hYwlNtpPvs8WCFxPA","peerUid":"703195149","channelId":"","guildId":"","guildCode":"0","fromUid":"0","fromAppid":"0","msgTime":"1708236269","msgMeta":"0x","sendStatus":2,"sendRemarkName":"","sendMemberName":"","sendNickName":"玉子是个废物喵","guildName":"","channelName":"","elements":[{"elementType":11,"elementId":"7336818910017867028","extBufForUI":"0x","textElement":null,"faceElement":null,"marketFaceElement":{"itemType":6,"faceInfo":1,"emojiPackageId":236919,"subType":3,"mediaType":0,"imageWidth":200,"imageHeight":200,"faceName":"[哼啊啊啊]","emojiId":"788098e150c03359a6230afe00bc6d28","key":"3ff9ac7000ac14d3","param":null,"mobileParam":null,"sourceType":0,"startTime":0,"endTime":0,"emojiType":1,"hasIpProduct":0,"voiceItemHeightArr":null,"sourceName":null,"sourceJumpUrl":null,"sourceTypeName":"","backColor":null,"volumeColor":null,"staticFacePath":"/home/yuchuxi/.config/QQ/nt_qq_66e7900397d8072e982cf55ad59ab0fa/nt_data/Emoji/marketface/236919/788098e150c03359a6230afe00bc6d28_aio.png","dynamicFacePath":"/home/yuchuxi/.config/QQ/nt_qq_66e7900397d8072e982cf55ad59ab0fa/nt_data/Emoji/marketface/236919/788098e150c03359a6230afe00bc6d28","supportSize":[{"width":300,"height":300},{"width":200,"height":200}],"apngSupportSize":null},"replyElement":null,"picElement":null,"pttElement":null,"videoElement":null,"grayTipElement":null,"arkElement":null,"fileElement":null,"liveGiftElement":null,"markdownElement":null,"structLongMsgElement":null,"multiForwardMsgElement":null,"giphyElement":null,"walletElement":null,"inlineKeyboardElement":null,"textGiftElement":null,"calendarElement":null,"yoloGameResultElement":null,"avRecordElement":null,"structMsgElement":null,"faceBubbleElement":null,"shareLocationElement":null,"tofuRecordElement":null,"taskTopMsgElement":null}],"records":[],"emojiLikesList":[],"commentCnt":"0","directMsgFlag":0,"directMsgMembers":[],"peerName":"=(ㅇㅅㅇ)=机器人测试","freqLimitInfo":null,"editable":false,"avatarMeta":"","avatarPendant":"","feedId":"","roleId":"0","timeStamp":"0","clientIdentityInfo":null,"isImportMsg":false,"atType":0,"roleType":0,"fromChannelRoleInfo":{"roleId":"0","name":"","color":0},"fromGuildRoleInfo":{"roleId":"0","name":"","color":0},"levelRoleInfo":{"roleId":"0","name":"","color":0},"recallTime":"0","isOnlineMsg":true,"generalFlags":"0x","clientSeq":"0","fileGroupSize":null,"foldingInfo":null,"multiTransInfo":null,"senderUin":"3619545924","peerUin":"703195149","msgAttrs":{},"anonymousExtInfo":null,"nameType":0,"avatarFlag":0,"extInfoForUI":null,"personalMedal":null,"categoryManage":0,"msgShortId":1708185805507}
2024/2/18 14:04:30 傻fufu的(3380643076): 新消息事件HTTP上报成功: http://127.0.0.1:47826/onebot/v11/ {"self_id":3380643076,"user_id":3619545924,"time":1708236269,"message_id":1708185805507,"real_id":"7336818910017867029","message_type":"group","sender":{"user_id":3619545924,"nickname":"玉子是个废物喵","card":"","role":"admin"},"raw_message":"","font":14,"sub_type":"normal","message":[],"post_type":"message","group_id":703195149}
LLOneBot版本:2.5.0
BUG描述:
"message":[{"data":{},"type":"at"},{"data":{"text":" asdf"},"type":"text"}]
at群员上报的data为空
和私聊没有sender是同一个情况(不过现在私聊的已经修复了
临时信息的类型是:"message_type": "others", "detail_type": "others"
回复消息上报时偶尔会缺少"data.id"字段导致Nonebot报 Error when getting message reply info: KeyError('id') 错误。
比如
"message": [
{
"data": {
"id": "xxxxxxxxxxxxx" <--
},
"type": "reply"
},
{
"data": {
"text": "我不是笨蛋"
},
"type": "text"
}
]
"message": [
{
"data": {}, <--
"type": "reply"
},
{
"data": {
"text": "我不是笨蛋"
},
"type": "text"
}
]
可以直接用 "" 填充吗?
能否将撤回消息事件支持上报?
现在好友跟群消息撤回都没有上报
刚开始使用可以发送几条,之后发送code200,但是并没有发送出去,切换qq账号后,会把之前没有发送出去的消息一并发送出去,这是qq的限制吗?好友消息并没有这种问题
在对接 NoneBot2 OneBot 适配器时,发现上报消息事件时,缺少 raw_message 和 font 两个字段,导致上报失败
在测试中,发现上报数据中,补充添加 {"raw_message": "", "font": 0},即可上报成功(不过这样的话, raw_message 的实际内容是错误的,且查看 onebot-v11 文档后,并未发现如何处理 raw_message 的相关信息,不知道作者要如何处理 raw_message,要转 cq 码吗?)
参考的文档:[onebot-v11]群消息事件数据
NoneBot2 OneBot 适配器项目地址:NoneBot2 OneBot 适配器
QQ版本:9.9.6-19480 (64位)
LLOneBot版本:3.06
调用LLOneBot的方式或者应用端(如postman直接调用,或NoneBot2、Koishi):自己写的http客户端
BUG描述:
访问本机3000端口
llonebot已启动
终结点get_msg
{"status":-1,"retcode":-1,"data":null,"message":"TypeError: Cannot read properties of undefined (reading 'toString')"}
其他终结点似乎正常
访问本机8080端口(设置的上报地址)或默认地址无法访问
LLOneBot日志:全都是这个
2024/2/14 11:19:48 砰砰机器人(3542366478): 新消息事件上报失败: http://127.0.0.1:8080/ TypeError: fetch failed
现在 json 卡片(如小程序分享)的事件上报是 [{'data': {}, 'type': 'unknown'}]
,能否增加 json 卡片的支持?
尽管go-cqhttp基于OneBot API开发,然而其部分包对OneBot API规定的内容有所扩展(如get_version_info这一API,go-cqhttp除了实现了OneBot API规定必须实现的app_name
,app_version
和protocol_version
外,还额外添加了许多其他信息(如运行时环境参数,运行系统等))。现有的机器人插件大部分基于go-cqhttp开发,因此目前部分API由于缺少go-cqhttp独有的部分字段,而使得这些插件无法直接迁移。
想询问一下作者您是否有意向让本插件做到尽量完全兼容go-cqhttp(尽管这样会引入一些历史包袱),如果您有意向完成该工作,我可以着手先尝试对一些API做出修改(前提是开学后我这边别太忙)
QQ版本:9.9.7-20979 (64位)
LLOneBot版本:1.0.3
调用LLOneBot的方式或者应用端(如postman直接调用,或NoneBot2、Koishi):自写http客户端,插件形式的。
BUG描述:3.0.6发群消息文本,返回的sub_type为friend,应该是group
复现步骤:在群里发消息,看sub_type
LLOneBot日志:没有这个时间段的日志,找了,就是测试发群消息,没有这部分的日志。
QQ版本:9.9.7-20979
LLOneBot版本:3.6.0
调用LLOneBot的方式或者应用端(如postman直接调用,或NoneBot2、Koishi):Trss-yunzai
BUG描述:无法上传mp4文件
复现步骤:上传mp4文件
LLOneBot日志:
2024/2/22 14:21:53 洛箐箐(脱敏内容): 可以进行发送消息,设置发送成功回调 {}
2024/2/22 14:21:53 洛箐箐(脱敏内容): ws 消息上报 ws://localhost:2536/go-cqhttp {"status":"ok","retcode":0,"data":{"message_id":脱敏内容},"message":"","wording":"","echo":"41325f34-511a-440d-afdd-7267bdeac730"}
2024/2/22 14:21:54 洛箐箐(脱敏内容): 收到反向Websocket消息 {"action":"send_msg","params":{"group_id":脱敏内容,"message":[{"type":"video","data":{"file":"./data/rcmp4/脱敏内容/temp.mp4"}}]},"echo":"9741aad6-4896-4007-9787-2d726dffb052"}
2024/2/22 14:21:54 洛箐箐(脱敏内容): ws 消息上报 ws://localhost:2536/go-cqhttp {"status":"failed","retcode":1200,"data":null,"message":"消息体无法解析","wording":"消息体无法解析","echo":"9741aad6-4896-4007-9787-2d726dffb052"}
QQ版本:9.9.7-21484 (64位)
LLOneBot版本:3.2.0
调用LLOneBot的方式或者应用端(如postman直接调用,或NoneBot2、Koishi):websocket客户端
BUG描述:QQ表情(不是emoji,type是face)发不出去,接收消息时message数组内没有表情对应的元素(会被隔过去),若消息只有一个表情就会像下面日志里一样,message为空。
复现步骤:用websocket按onebot的文档说明发送、接收带QQ表情的消息
LLOneBot日志: (以下QQ号和群号都正常,应该不影响修bug,为保护隐私均隐去,谢谢理解)
新消息事件ws上报 {"self_id":机器人qq号,"user_id":发送者qq号,"time":1708168268,"message_id":1708136861544,"real_id":"7336526847486895820","message_type":"group","sender":{"user_id":发送者qq号,"nickname":" ","card":"","role":"admin"},"raw_message":"","font":14,"sub_type":"normal","message":[{"data":{"text":"测试表情:"},"type":"text"},{"data":{"text":"这是表情后面的文字"},"type":"text"}],"post_type":"message","group_id":群号}
2024/2/17 19:11:11 (3408556564): 新消息事件HTTP上报失败: http://192.168.1.2:5000/ TypeError: fetch failed{"self_id":机器人qq号,"user_id":发送者qq号,"time":1708168268,"message_id":1708136861544,"real_id":"7336526847486895820","message_type":"group","sender":{"user_id":发送者qq号,"nickname":" ","card":"","role":"admin"},"raw_message":"","font":14,"sub_type":"normal","message":[{"data":{"text":"测试表情:"},"type":"text"},{"data":{"text":"这是表情后面的文字"},"type":"text"}],"post_type":"message","group_id":群号}
建议增加创建群文件夹、删除群文件夹的API。
如果上传群文件时支持选择文件夹目录就更好了
QQ版本: 9.9.7-21484 (64位)
LLOneBot版本:3.3.0
调用LLOneBot的方式或者应用端(如postman直接调用,或NoneBot2、Koishi):精易网页助手
BUG描述:根据 onebot11规范
https://github.com/botuniverse/onebot-11/blob/master/api/public.md#get_group_info-获取群信息
返回的响应数据该有member_count和max_member_count。没有这俩数据不符合onebot11规范。在之前的版本有这个member_count的,我都做好了调用,结果更新了版本后失效了。。。
复现步骤:http://127.0.0.1:3000/get_group_list
LLOneBot日志:不需要
LLOneBot版本:v3.0.0
1.get_login_info 返回的nickname不对
2.接收图片消息不会自动下载了,例如下方路径并不存在图片,需要自己手动切换到界面才会下载图片
c:\Documents\Tencent Files\123456\nt_qq\nt_data\Pic\2024-02\Ori\9159f537d22d14d7ca88699464d0aa6c.png
上述2个问题旧版没问题
3.艾特群员的data依然为空
{"data":{},"type":"at"}
4.manifest.json中的version依然是2.5.0
现在好像也没有机器人能给名片点赞吧,做了不是要挨打
QQ版本:Linux 3.2.5-20811
LLOneBot版本:3.1.0
调用LLOneBot的方式或者应用端(如postman直接调用,或NoneBot2、Koishi):ZeroBot
BUG描述:ZeroBot无法连接到WebSocket
ZeroBot日志如下
INFO[0004] [ws] 开始尝试连接到Websocket服务器: ws://127.0.0.1:11453
WARN[0004] [ws] 与Websocket服务器 ws://127.0.0.1:11453 握手时出现错误: invalid character 'W' looking for beginning of value
复现步骤:使用ZeroBot-Plugin连接WebSocket
LLOneBot日志:
2024/2/16 03:45:34 (xxxxxxxxxxx): event上报ws客户端已连接
2024/2/16 03:45:36 (xxxxxxxxxxx): event上报ws客户端已连接
2024/2/16 03:45:36 (xxxxxxxxxxx): event上报ws客户端已断开
2024/2/16 03:45:37 (xxxxxxxxxxx): event上报ws客户端已断开
这里提供一个音乐分享消息类型的message:
{
"type": "music",
"data": {
"type": "custom",
"url": "https://....",
"audio": "https://....",
"title": "冬の花"
}
}
如图所示,preload.ts
的 sendSendMsgResult
可被渲染端调用执行来发送任意的消息
安全提示来源:electron 文档进程间通信中提到的安全警告
2. 通过预加载脚本暴露 ipcRenderer.send
或许可以采用以下这种方式来规避这个问题?(只是个人建议)
图中红框部分代码:
MessageGroup.ts
const msg = await sendIPCMsgAsync<MessageElement, Data>(
CHANNEL_HANDLE_SINGLE_MESSAGE,
CHANNEL_BACK_SINGLE_MESSAGE,
oriMessage
)
IPCSend.ts
export interface SendIPCMsgSession<T> {
id: string
data: T
}
export function sendIPCMsgAsync<T, V>(
channelTo: string,
channelBack: string,
data: T
) {
return new Promise<V>((resolve) => {
const onceSessionId = `${channelTo}____${uuid4()}`
const handler = (event: any, result: SendIPCMsgSession<V>) => {
if (result.id === onceSessionId) {
resolve(result.data)
ipcMain.off(channelBack, handler)
return
}
}
ipcMain.on(channelBack, handler)
sendIPCMsg(channelTo, {
id: onceSessionId,
data,
})
})
}
preload.ts
// 感觉 sendSendMsgResult 的实现不安全,因此更改了实现方式
handleSingleMessage: (callback: (session: SendIPCMsgSession<MessageElement>) => void) => {
ipcRenderer.on(
CHANNEL_HANDLE_SINGLE_MESSAGE,
(_event, value) => callback(value)
)
},
backSingleMessage: <T>(data: T) => {
ipcRenderer.send(
CHANNEL_BACK_SINGLE_MESSAGE,
data
)
},
QQ版本:Linux 3.2.5-20811 arm64
LLOneBot版本:v3.4.0
调用LLOneBot的方式或者应用端(如postman直接调用,或NoneBot2、Koishi):ZeroBot
BUG描述:无法发送合并转发消息:缺失接口send_private_forward_msg
复现步骤:调用send_private_forward_msg
接口
LLOneBot日志: 不需要
能不能设置关闭输出到\LiteLoaderQQNT\data\LLOneBot的调试信息?
已经检查所有issue,LLAPI为 #4 中提及的最新版本。
如图,无法正常使用API,启动log如下:
像上一位 closed 的 issuer 一样使用 chrome 网络台发送请求,得到的结果也是一样的。
QQ版本:9.9.7-20979
LLOneBot版本:3.3.1
调用LLOneBot的方式或者应用端(如postman直接调用,或NoneBot2、Koishi):云崽(Miao-Yunzai通过ws-plugin连接)及ZeroBot-Plugin(ws连接)
BUG描述:启用云崽、ZeroBot-Plugin时显示成功连接(见图),但云崽无任何消息进入,发送任何消息均无反应,ZeroBot-Plugin有显示报错(见第二条回复),测试mirai的overflow项目可以正常连接并接收消息。
复现步骤:无
LLOneBot日志:云崽测试时LLOneBot日志仅显示收到新消息,无消息上报及ws连接提示;ZeroBot-Plugin测试时有显示ws客户端已连接及ws消息上报
QQ版本:9.9.7-21484 (windows)
LLOneBot版本:3.4.0
调用LLOneBot的方式或者应用端(如postman直接调用,或NoneBot2、Koishi):NoneBot2(zhenxunBot)
BUG描述:bot发送合并转发消息时发生错误,导致无法正常发送;
复现步骤:用户请求多张图片 -> bot收到后开始下载 -> 全部下载完成,开始合并转发发送 -> 发送出错 -> 没有收到任何返回消息
LLOneBot日志: https://paste.ubuntu.com/p/93w9RZTZK4/
NoneBot 日志:nonebot.adapters.onebot.v11.exception.ActionFailed: ActionFailed(status='failed', retcode=1404, data=None, echo='2231', message='不支持的api send_group_forward_msg')
我使用ffmpeg将mp3的音频文件转换为了mar的音频文件,发送后提示发送成功,但实际上并没有发送。
post请求http://127.0.0.1:3000/send_msg
{
"message_type": "group",
"group_id": 701339984,
"message": [
{
"type": "record",
"data": {
"file": "http://127.0.0.1:8021/audio.amr" // 注释后加的,这是我放在文件服务器上的文件地址
}
}
],
"auto_escape": true
}
这是Bot上报的数据:
{
"status": 200,
"retcode": 0,
"data": [
{
"type": "record",
"data": {
"file": "http://127.0.0.1:8021/audio.amr"
}
}
],
"message": "发送成功"
}
除此之外我还尝试了.wav、.mp3、.silk的相关文件类型,结果都没有成功。
这是我转换的源码:
public static void transferMp3Amr(String mp3Path, String target) {
File source = new File(path);
try {
if (!source.exists()) {
throw new Exception("文件不存在!");
}
List<String> commend = new ArrayList<String>();
commend.add(path + "ffmpeg.exe");
commend.add("-y");
commend.add("-i");
commend.add(mp3Path);
commend.add("-ac");
commend.add("1");
commend.add("-ar");
commend.add("8000");
commend.add(target);
try {
ProcessBuilder builder = new ProcessBuilder();
builder.command(commend);
Process p = builder.start();
p.waitFor();
} catch (Exception e) {
e.printStackTrace();
}
} catch (Exception e) {
System.out.println("mp3转amr异常...");
e.printStackTrace();
}
}
我不太明白作者说的silk编码的amr是什么意思,所以就直接转了,如果是我转换有问题,还请指出,谢谢。
比如在 render handleNewMessage
中直接将所有 message 进行 JSON 序列化后发给另一个指定的上报服务器,作为测试以及在onebotapi支持不完全的时候的替代来使用?
QQ版本:Windows 9.9.7-21484 x64
LLOneBot版本:v3.2.0
调用LLOneBot的方式或者应用端(如postman直接调用,或NoneBot2、Koishi):mirai-overflow / Postman
BUG描述:overflow鉴权的时候会传递一个查询参数。
插件没设置token时:
收到无参数请求(ws://127.0.0.1:14515
)可正常连接
收到任意带参数请求(ws://127.0.0.1:14515?access_token=moe
或 ws://127.0.0.1:14515?wejihweuyfefw
)会卡住
插件设置token后:
收到不含access_token参数的请求(ws://127.0.0.1:14515?eruif3g48
)时会断开连接
收到含token的参数(ws://127.0.0.1:14515?access_token=moe&c8w7gf87ewg=32
)的时候会卡住
使用Postman发送可触发此bug
无token的Postman图:
图2:
overflow日志:
2024-02-16 22:34:11 I/Onebot: Overflow v2.16.0-795845b-SNAPSHOT 正在运行
2024-02-16 22:34:11 I/Onebot: 连接到 WebSocket: ws://127.0.0.1:14514
2024-02-16 22:34:11 I/Onebot: ▌ 已连接到服务器 ┈━═☆
2024-02-16 22:34:21 W/Onebot: Request failed: [get_version_info, echo=0] Timed out waiting for 10000 ms
2024-02-16 22:34:21 I/Onebot: 服务端版本信息
{
"status": "failed",
"retcode": -1,
"message": "Timed out waiting for 10000 ms"
}
2024-02-16 22:34:31 W/Onebot: Request failed: [get_login_info, echo=1] Timed out waiting for 10000 ms
复现步骤:同上
LLOneBot日志:
2024/2/16 22:36:24 : received ws connect /?access_token=uidgw
2024/2/16 22:36:24 : receive ws url token uidgw
感谢作者制作了这个插件, 很好用
如果能够支持 Satori 协议就更好了
Satori 有完整的协议文档
https://satori.chat/zh-CN or https://satori.js.org/
GitHub 源代码
相比于 Onebot 更加清晰, 更加通用
使用了 TypeScript 开发
协议中类型等常量在 @satorijs/protocol
中均有列出 https://github.com/satorijs/satori/blob/master/packages/protocol/
并且, 很多框架都支持 Satori 协议
Koishi - @koishijs/plugin-adapter-satori 上游 @satorijs/adapter-satori
Nonebot2 - nonebot-adapter-satori
Avilla - https://github.com/GraiaProject/Avilla/tree/master/avilla/satori
而 Onebot 已经被 Koishi 移入社区支持,
类似的 Chronocat 也推荐使用 Satori 协议, 而不是 Red (一个基于 Onebot 协议的扩展协议)
使用 Koishi 框架, 测试 Bot 的日常使用
使用 logirl 可以在终端中连接 Satori 以接受并显示消息
qq版本: 9.9.7-20811 (64位)
llapi版本:1.3.1
llonebot版本:2.1.1
尽管OneBot API v11规范中未做出要求,但是现在大部分框架都支持,当检测到send_private_msg
这一API请求中出现group_id
字样时,自动判断为从群号为group_id
这个群中向QQ号为user_id
的人发送陌生人私聊消息。建议支持这一额外特性,以方便机器人发起私聊消息。
https://t.me/+nLZEnpne-pQ1OWFl
这种协议端懂的都懂,说不定哪天就无了,最终的结果也会是chronocat一样的
QQ版本:3.2.5-21357
LLOneBot版本:3.0.3
调用LLOneBot的方式或者应用端(如postman直接调用,或NoneBot2、Koishi):NoneBot2
BUG描述:用户的群昵称和昵称不一致时,会无法获取昵称
复现步骤:在QQ群里把群昵称改掉
LLOneBot日志:
2024/2/16 15:57:44 墨子不是猫(3380643076): 新消息事件上报成功: http://127.0.0.1:47826/onebot/v11/ {"self_id":"3380643076","user_id":"1799474509","time":1708070264,"message_id":"7336105919116575966","real_id":"7336105919116575966","message_type":"group","sender":{"user_id":"1799474509","nickname":"小猫吖库","card":"","role":"member"},"raw_message":"","font":14,"sub_type":"friend","message":[{"data":{"text":"你想你靠在我肩上我亲你一口不过分吧"},"type":"text"}],"post_type":"message","group_id":"915328909"}
2024/2/16 15:57:47 墨子不是猫(3380643076): 收到新消息,push到历史记录 {"msgId":"7336105933166547157","msgRandom":"1410447096","msgSeq":"504386","cntSeq":"0","chatType":2,"msgType":2,"subMsgType":1,"sendType":0,"senderUid":"u_Rvrm6x7EkLufjieJIFGOOg","peerUid":"781043201","channelId":"","guildId":"","guildCode":"0","fromUid":"0","fromAppid":"0","msgTime":"1708070266","msgMeta":"0x","sendStatus":2,"sendRemarkName":"","sendMemberName":"","sendNickName":"离囚号(废物)","guildName":"","channelName":"","elements":[{"elementType":1,"elementId":"7336105933166547156","extBufForUI":"0x","textElement":{"content":"细狗😡","atType":0,"atUid":"0","atTinyId":"0","atNtUid":"","subElementType":0,"atChannelId":"0","linkInfo":null,"atRoleId":"0","atRoleColor":0,"atRoleName":"","needNotify":0},"faceElement":null,"marketFaceElement":null,"replyElement":null,"picElement":null,"pttElement":null,"videoElement":null,"grayTipElement":null,"arkElement":null,"fileElement":null,"liveGiftElement":null,"markdownElement":null,"structLongMsgElement":null,"multiForwardMsgElement":null,"giphyElement":null,"walletElement":null,"inlineKeyboardElement":null,"textGiftElement":null,"calendarElement":null,"yoloGameResultElement":null,"avRecordElement":null,"structMsgElement":null,"faceBubbleElement":null,"shareLocationElement":null,"tofuRecordElement":null,"taskTopMsgElement":null}],"records":[],"emojiLikesList":[],"commentCnt":"0","directMsgFlag":0,"directMsgMembers":[],"peerName":"可爱の艾拉❤️可塑性","freqLimitInfo":null,"editable":false,"avatarMeta":"","avatarPendant":"","feedId":"","roleId":"0","timeStamp":"0","clientIdentityInfo":null,"isImportMsg":false,"atType":0,"roleType":0,"fromChannelRoleInfo":{"roleId":"0","name":"","color":0},"fromGuildRoleInfo":{"roleId":"0","name":"","color":0},"levelRoleInfo":{"roleId":"0","name":"","color":0},"recallTime":"0","isOnlineMsg":true,"generalFlags":"0x","clientSeq":"0","fileGroupSize":null,"foldingInfo":null,"multiTransInfo":null,"senderUin":"3096390360","peerUin":"781043201","msgAttrs":{},"anonymousExtInfo":null,"nameType":0,"avatarFlag":0,"extInfoForUI":null,"personalMedal":null,"categoryManage":0}
2024/2/16 15:57:47 墨子不是猫(3380643076): 新消息事件上报成功: http://127.0.0.1:47826/onebot/v11/ {"self_id":"3380643076","user_id":"3096390360","time":1708070266,"message_id":"7336105933166547157","real_id":"7336105933166547157","message_type":"group","sender":{"user_id":"3096390360","nickname":"离囚号(废物)","card":"","role":"admin"},"raw_message":"","font":14,"sub_type":"friend","message":[{"data":{"text":"细狗😡"},"type":"text"}],"post_type":"message","group_id":"781043201"}
2024/2/16 15:57:51 墨子不是猫(3380643076): 收到新消息,push到历史记录 {"msgId":"7336105950764948274","msgRandom":"721831372","msgSeq":"196471","cntSeq":"0","chatType":2,"msgType":2,"subMsgType":2,"sendType":0,"senderUid":"u_qalA_QeSNy5VWDJDKpJ9og","peerUid":"849331680","channelId":"","guildId":"","guildCode":"0","fromUid":"0","fromAppid":"0","msgTime":"1708070271","msgMeta":"0x","sendStatus":2,"sendRemarkName":"","sendMemberName":"Episode","sendNickName":"","guildName":"","channelName":"","elements":[{"elementType":2,"elementId":"7336105950764948273","extBufForUI":"0x","textElement":null,"faceElement":null,"marketFaceElement":null,"replyElement":null,"picElement":{"picSubType":0,"fileName":"8980813151F6E7DE78E31369036256D9.jpg","fileSize":"47748","picWidth":962,"picHeight":550,"original":false,"md5HexStr":"8980813151f6e7de78e31369036256d9","sourcePath":"/home/yuchuxi/.config/QQ/nt_qq_66e7900397d8072e982cf55ad59ab0fa/nt_data/Pic/2024-02/Ori/8980813151f6e7de78e31369036256d9.jpg","thumbPath":{},"transferStatus":0,"progress":0,"picType":1000,"invalidState":0,"fileUuid":"3106491706","fileSubId":"","thumbFileSize":0,"fileBizId":null,"downloadIndex":null,"summary":"","emojiFrom":0,"emojiWebUrl":null,"emojiAd":{"url":"","desc":""},"emojiMall":{"packageId":0,"emojiId":0},"emojiZplan":{"actionId":0,"actionName":"","actionType":0,"playerNumber":0,"peerUid":"0","bytesReserveInfo":""},"originImageMd5":"8E300D7851B3CF2351B7D5B178E74242","originImageUrl":"/gchatpic_new/3807427761/849331680-3106491706-8980813151F6E7DE78E31369036256D9/0?term=255&is_origin=0","import_rich_media_context":null,"isFlashPic":false},"pttElement":null,"videoElement":null,"grayTipElement":null,"arkElement":null,"fileElement":null,"liveGiftElement":null,"markdownElement":null,"structLongMsgElement":null,"multiForwardMsgElement":null,"giphyElement":null,"walletElement":null,"inlineKeyboardElement":null,"textGiftElement":null,"calendarElement":null,"yoloGameResultElement":null,"avRecordElement":null,"structMsgElement":null,"faceBubbleElement":null,"shareLocationElement":null,"tofuRecordElement":null,"taskTopMsgElement":null}],"records":[],"emojiLikesList":[],"commentCnt":"0","directMsgFlag":0,"directMsgMembers":[],"peerName":"米綾幼儿园🍭","freqLimitInfo":null,"editable":false,"avatarMeta":"","avatarPendant":"","feedId":"","roleId":"0","timeStamp":"0","clientIdentityInfo":null,"isImportMsg":false,"atType":0,"roleType":0,"fromChannelRoleInfo":{"roleId":"0","name":"","color":0},"fromGuildRoleInfo":{"roleId":"0","name":"","color":0},"levelRoleInfo":{"roleId":"0","name":"","color":0},"recallTime":"0","isOnlineMsg":true,"generalFlags":"0x","clientSeq":"0","fileGroupSize":null,"foldingInfo":null,"multiTransInfo":null,"senderUin":"3807427761","peerUin":"849331680","msgAttrs":{},"anonymousExtInfo":null,"nameType":0,"avatarFlag":0,"extInfoForUI":null,"personalMedal":null,"categoryManage":0}
2024/2/16 15:57:51 墨子不是猫(3380643076): 新消息事件上报成功: http://127.0.0.1:47826/onebot/v11/ {"self_id":"3380643076","user_id":"3807427761","time":1708070271,"message_id":"7336105950764948274","real_id":"7336105950764948274","message_type":"group","sender":{"user_id":"3807427761","nickname":"","card":"Episode","role":"member"},"raw_message":"","font":14,"sub_type":"friend","message":[{"data":{"file_id":"3106491706","path":"/home/yuchuxi/.config/QQ/nt_qq_66e7900397d8072e982cf55ad59ab0fa/nt_data/Pic/2024-02/Ori/8980813151f6e7de78e31369036256d9.jpg","file":"file:///home/yuchuxi/.config/QQ/nt_qq_66e7900397d8072e982cf55ad59ab0fa/nt_data/Pic/2024-02/Ori/8980813151f6e7de78e31369036256d9.jpg"},"type":"image"}],"post_type":"message","group_id":"849331680"}
2024/2/16 15:57:52 墨子不是猫(3380643076): 收到新消息,push到历史记录 {"msgId":"7336105954553155346","msgRandom":"542732607","msgSeq":"317046","cntSeq":"0","chatType":2,"msgType":9,"subMsgType":33,"sendType":0,"senderUid":"u_ZFTcBsllLmx-8A20mqfYDg","peerUid":"812766886","channelId":"","guildId":"","guildCode":"0","fromUid":"0","fromAppid":"0","msgTime":"1708070271","msgMeta":"0x","sendStatus":2,"sendRemarkName":"","sendMemberName":"正经图吧小白","sendNickName":"","guildName":"","channelName":"","elements":[{"elementType":7,"elementId":"7336105954553155335","extBufForUI":"0x","textElement":null,"faceElement":null,"marketFaceElement":null,"replyElement":{"replayMsgId":"0","replayMsgSeq":"317044","replayMsgRootSeq":"317044","replayMsgRootMsgId":"0","replayMsgRootCommentCnt":"0","sourceMsgIdInRecords":"7336105954553155345","sourceMsgText":"","sourceMsgTextElems":[{"replyAbsElemType":1,"textElemContent":"魔兽还能玩吗","faceElem":null}],"senderUid":"568730839","senderUidStr":"u_qrbmaxFka9tYvZMoM-WkSg","replyMsgClientSeq":"0","replyMsgTime":"1708070146","replyMsgRevokeType":0,"sourceMsgIsIncPic":false,"sourceMsgExpired":false,"anonymousNickName":null,"originalMsgState":null},"picElement":null,"pttElement":null,"videoElement":null,"grayTipElement":null,"arkElement":null,"fileElement":null,"liveGiftElement":null,"markdownElement":null,"structLongMsgElement":null,"multiForwardMsgElement":null,"giphyElement":null,"walletElement":null,"inlineKeyboardElement":null,"textGiftElement":null,"calendarElement":null,"yoloGameResultElement":null,"avRecordElement":null,"structMsgElement":null,"faceBubbleElement":null,"shareLocationElement":null,"tofuRecordElement":null,"taskTopMsgElement":null},{"elementType":1,"elementId":"7336105954553155340","extBufForUI":"0x","textElement":{"content":"@凡人","atType":2,"atUid":"0","atTinyId":"0","atNtUid":"u_qrbmaxFka9tYvZMoM-WkSg","subElementType":0,"atChannelId":"0","linkInfo":null,"atRoleId":"0","atRoleColor":0,"atRoleName":"","needNotify":0},"faceElement":null,"marketFaceElement":null,"replyElement":null,"picElement":null,"pttElement":null,"videoElement":null,"grayTipElement":null,"arkElement":null,"fileElement":null,"liveGiftElement":null,"markdownElement":null,"structLongMsgElement":null,"multiForwardMsgElement":null,"giphyElement":null,"walletElement":null,"inlineKeyboardElement":null,"textGiftElement":null,"calendarElement":null,"yoloGameResultElement":null,"avRecordElement":null,"structMsgElement":null,"faceBubbleElement":null,"shareLocationElement":null,"tofuRecordElement":null,"taskTopMsgElement":null},{"elementType":1,"elementId":"7336105954553155341","extBufForUI":"0x","textElement":{"content":" 能","atType":0,"atUid":"0","atTinyId":"0","atNtUid":"","subElementType":0,"atChannelId":"0","linkInfo":null,"atRoleId":"0","atRoleColor":0,"atRoleName":"","needNotify":0},"faceElement":null,"marketFaceElement":null,"replyElement":null,"picElement":null,"pttElement":null,"videoElement":null,"grayTipElement":null,"arkElement":null,"fileElement":null,"liveGiftElement":null,"markdownElement":null,"structLongMsgElement":null,"multiForwardMsgElement":null,"giphyElement":null,"walletElement":null,"inlineKeyboardElement":null,"textGiftElement":null,"calendarElement":null,"yoloGameResultElement":null,"avRecordElement":null,"structMsgElement":null,"faceBubbleElement":null,"shareLocationElement":null,"tofuRecordElement":null,"taskTopMsgElement":null}],"records":[{"msgId":"7336105954553155345","msgRandom":"0","msgSeq":"317044","cntSeq":"0","chatType":2,"msgType":2,"subMsgType":1,"sendType":0,"senderUid":"u_qrbmaxFka9tYvZMoM-WkSg","peerUid":"812766886","channelId":"","guildId":"","guildCode":"0","fromUid":"0","fromAppid":"0","msgTime":"1708070146","msgMeta":"0x","sendStatus":2,"sendRemarkName":"","sendMemberName":"","sendNickName":"凡人","guildName":"","channelName":"","elements":[{"elementType":1,"elementId":"7336105954553155344","extBufForUI":"0x","textElement":{"content":"魔兽还能玩吗","atType":0,"atUid":"0","atTinyId":"0","atNtUid":"","subElementType":0,"atChannelId":"0","linkInfo":null,"atRoleId":"0","atRoleColor":0,"atRoleName":"","needNotify":0},"faceElement":null,"marketFaceElement":null,"replyElement":null,"picElement":null,"pttElement":null,"videoElement":null,"grayTipElement":null,"arkElement":null,"fileElement":null,"liveGiftElement":null,"markdownElement":null,"structLongMsgElement":null,"multiForwardMsgElement":null,"giphyElement":null,"walletElement":null,"inlineKeyboardElement":null,"textGiftElement":null,"calendarElement":null,"yoloGameResultElement":null,"avRecordElement":null,"structMsgElement":null,"faceBubbleElement":null,"shareLocationElement":null,"tofuRecordElement":null,"taskTopMsgElement":null}],"records":[],"emojiLikesList":[],"commentCnt":"0","directMsgFlag":0,"directMsgMembers":[],"peerName":"纯洁垃圾佬硬件交流群","freqLimitInfo":null,"editable":false,"avatarMeta":"","avatarPendant":"","feedId":"","roleId":"0","timeStamp":"0","clientIdentityInfo":null,"isImportMsg":false,"atType":0,"roleType":0,"fromChannelRoleInfo":{"roleId":"0","name":"","color":0},"fromGuildRoleInfo":{"roleId":"0","name":"","color":0},"levelRoleInfo":{"roleId":"0","name":"","color":0},"recallTime":"0","isOnlineMsg":false,"generalFlags":"0x","clientSeq":"0","fileGroupSize":null,"foldingInfo":null,"multiTransInfo":null,"senderUin":"568730839","peerUin":"812766886","msgAttrs":{},"anonymousExtInfo":null,"nameType":0,"avatarFlag":0,"extInfoForUI":null,"personalMedal":null,"categoryManage":0}],"emojiLikesList":[],"commentCnt":"0","directMsgFlag":0,"directMsgMembers":[],"peerName":"纯洁垃圾佬硬件交流群","freqLimitInfo":null,"editable":false,"avatarMeta":"","avatarPendant":"","feedId":"","roleId":"0","timeStamp":"0","clientIdentityInfo":null,"isImportMsg":false,"atType":2,"roleType":0,"fromChannelRoleInfo":{"roleId":"0","name":"","color":0},"fromGuildRoleInfo":{"roleId":"0","name":"","color":0},"levelRoleInfo":{"roleId":"0","name":"","color":0},"recallTime":"0","isOnlineMsg":true,"generalFlags":"0x","clientSeq":"0","fileGroupSize":null,"foldingInfo":null,"multiTransInfo":null,"senderUin":"3511517520","peerUin":"812766886","msgAttrs":{},"anonymousExtInfo":null,"nameType":0,"avatarFlag":0,"extInfoForUI":null,"personalMedal":null,"categoryManage":0}
2024/2/16 15:57:52 墨子不是猫(3380643076): 新消息事件上报成功: http://127.0.0.1:47826/onebot/v11/ {"self_id":"3380643076","user_id":"3511517520","time":1708070271,"message_id":"7336105954553155346","real_id":"7336105954553155346","message_type":"group","sender":{"user_id":"3511517520","nickname":"","card":"正经图吧小白","role":"member"},"raw_message":"","font":14,"sub_type":"friend","message":[{"data":{"id":"7336105413472809453"},"type":"reply"},{"data":{"mention":"568730839","qq":"568730839"},"type":"at"},{"data":{"text":" 能"},"type":"text"}],"post_type":"message","group_id":"812766886"}
能否在配置界面显示出监听端口是否监听成功?
安装插件后,按照示例发送请求,返回 connect ECONNREFUSED
似乎和 LiteLoaderQQNT-Plugin-LLAPI 未启用有关系
配置:
用命令行启动 qq 后的日志:
D:\Program Files\Tencent\QQNT>qq.exe
D:\Program Files\Tencent\QQNT>not mini app.
[app]module file name: D:\Program Files\Tencent\QQNT\QQ.exe
7769277bc358f63dc786c6697c1daaef9b844c4a99d3d74a187e902cc817485e
2a48aa9afca3e84d2930d5fed18084d9132cddcb3921a326c572ef2bc2e7f96e
643a4a860c15c91827bf0f2a77510172a980fc5d3a18ef73ffec757ec3086463
c651b4bfa083cf6aebe2104226131a9dd351d0fd56d4863504bfa7d9f6d5071f
0
[preload] process type:
[app]module file name: D:\Program Files\Tencent\QQNT\QQ.exe
[preload] hotupdate base version: 9.9.6-19689
[preload] hotupdate current version: 9.9.6-20139
[preload] install app version: 9.9.6-19689
[preload] succeeded. D:\Program Files\Tencent\QQNT\resources\app\versions\9.9.6-20139\wrapper.node
[preload] succeeded. D:\Program Files\Tencent\QQNT\resources\app\versions\9.9.6-20139\major.node
[preload] succeeded. D:\Program Files\Tencent\QQNT\resources\app\app_launcher\launcher.node
[LiteLoader] Start finding all plugins.
[LiteLoader] Found plugin: LLOneBot
[LiteLoader] Found 1 plugins, start loading plugins.
[preload] register done. launcher.node
[preload] register done. major.node
[preload] register done. wrapper.node
14:07:13.046 > [hot update] hotUpdateApi checkHasMultipleQQ false
14:07:13.050 > [hot update] hotUpdateApi start clearOldVersions
14:07:13.051 > [hot update] hotUpdateApi curVersionZipPath is: D:\Program Files\Tencent\QQNT\resources\app\versions\9.9.6-20139.zip false
14:07:13.117 > [hot update] hotUpdateApi checkHasMultipleQQ false
14:07:13.119 > [hot update] hotUpdateApi checkIsOnErrorVersion 9.9.7-20811
14:07:13.121 > [hot update] hotUpdateApi checkIsOnErrorVersion res is false
14:07:13.186 > [hot update] hotUpdateApi cancel
14:07:13.187 > [hot update] onStatusChanged IDLE
14:07:13.189 > [hot update] onUpdateCancel
QQ版本:Windows 9.9.7-21484 x64
LLOneBot版本:v3.1.2
调用LLOneBot的方式或者应用端(如postman直接调用,或NoneBot2、Koishi):mirai-overflow
BUG描述:插件开启正向ws服务器,尝试用mirai overflow连接失败。阅读log发现overflow在向插件发送未支持的get_version_info
下面附上overflow日志:
2024-02-16 17:47:37 I/Onebot: Overflow v2.16.0-c7971b9-SNAPSHOT 正在运行
2024-02-16 17:47:37 I/Onebot: 连接到 WebSocket: ws://127.0.0.1:14514
2024-02-16 17:47:37 I/Onebot: ▌ 已连接到服务器 ┈━═☆
2024-02-16 17:47:37 W/stderr: Exception in thread "DefaultDispatcher-worker-1" java.lang.NullPointerException
2024-02-16 17:47:37 W/stderr: at cn.evolvefield.onebot.client.util.ListenerUtils.getMessageType(ListenerUtils.kt:51)
2024-02-16 17:47:37 W/stderr: at cn.evolvefield.onebot.client.util.ListenerUtils.getMessageType(ListenerUtils.kt:15)
2024-02-16 17:47:37 W/stderr: at cn.evolvefield.onebot.client.handler.EventBus.onReceive(EventBus.kt:39)
2024-02-16 17:47:37 W/stderr: at cn.evolvefield.onebot.client.connection.WSClient$onMessage$1.invokeSuspend(WSClient.kt:65)
2024-02-16 17:47:37 W/stderr: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2024-02-16 17:47:37 W/stderr: at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
2024-02-16 17:47:37 W/stderr: at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
2024-02-16 17:47:37 W/stderr: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
2024-02-16 17:47:37 W/stderr: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
2024-02-16 17:47:37 W/stderr: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
2024-02-16 17:47:37 W/stderr: Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [CoroutineName(overflow), StandaloneCoroutine{Cancelling}@12a195b3, Dispatchers.Default]
2024-02-16 17:47:47 W/Onebot: Request failed: [get_version_info, echo=0] Timed out waiting for 10000 ms
2024-02-16 17:47:47 I/Onebot: 服务端版本信息
{
"status": "failed",
"retcode": -1,
"message": "Timed out waiting for 10000 ms"
}
2024-02-16 17:47:47 W/stderr: Exception in thread "DefaultDispatcher-worker-1" java.lang.NullPointerException
2024-02-16 17:47:47 W/stderr: at cn.evolvefield.onebot.client.util.ListenerUtils.getMessageType(ListenerUtils.kt:51)
2024-02-16 17:47:47 W/stderr: at cn.evolvefield.onebot.client.util.ListenerUtils.getMessageType(ListenerUtils.kt:15)
2024-02-16 17:47:47 W/stderr: at cn.evolvefield.onebot.client.handler.EventBus.onReceive(EventBus.kt:39)
2024-02-16 17:47:47 W/stderr: at cn.evolvefield.onebot.client.connection.WSClient$onMessage$1.invokeSuspend(WSClient.kt:65)
2024-02-16 17:47:47 W/stderr: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2024-02-16 17:47:47 W/stderr: at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
2024-02-16 17:47:47 W/stderr: at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
2024-02-16 17:47:47 W/stderr: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
2024-02-16 17:47:47 W/stderr: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
2024-02-16 17:47:47 W/stderr: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
2024-02-16 17:47:47 W/stderr: Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [CoroutineName(overflow), StandaloneCoroutine{Cancelling}@41ea15aa, Dispatchers.Default]
2024-02-16 17:47:57 W/Onebot: Request failed: [get_login_info, echo=1] Timed out waiting for 10000 ms
2024-02-16 17:47:57 E/main: Failed to init MiraiConsole.
java.lang.NullPointerException: Cannot read field "userId" because "it.data" is null
at cn.evolvefield.onebot.client.core.Bot.getLoginInfo(Bot.kt:586)
at cn.evolvefield.onebot.client.core.Bot$getLoginInfo$1.invokeSuspend(Bot.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:33)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at top.mrxiaom.overflow.internal.plugin.OverflowCoreAsPlugin$TheLoader.enable(OverflowCoreAsPlugin.kt:156)
at net.mamoe.mirai.console.plugin.PluginManager.enablePlugin(PluginManager.kt:173)
at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.enableAllLoadedPlugins$mirai_console(PluginManagerImpl.kt:193)
at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:360)
at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:512)
at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:182)
at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:181)
at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:59)`
复现步骤: 使用 overflow / (github) 连接插件
LLOneBot日志:
2024/2/16 17:47:37 BOT(x): event上报ws客户端已连接
2024/2/16 17:47:37 BOT(x): 收到ws消息 {"action":"get_version_info","echo":0}
2024/2/16 17:47:47 BOT(x): 收到ws消息 {"action":"get_login_info","echo":1}
2024/2/16 17:47:59 BOT(x): event上报ws客户端已断开
另外,有机会支持一下鉴权吗,感觉这样会安全一些(
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.