Closed A-n-k-a closed 3 months ago
这个报错内容是llob返回给nb的,不是nb产生的,你应该找llob
我确认D:\Portable-Program-Files\nonebot\LLOneBot
这个路径是我安装nonebot的路径,不是LLOneBot的路径,只是我给nonebot设置的项目名称是LLOneBot
,应该就是nonebot的报错,LLOneBot没有.venv这样的虚拟环境,而且LLOneBot不是Python写的,报错也不应该是这个格式的。
补充一下刚刚重新测试时的LLOneBot端日志:
2024/6/9 09:43:52 亚托莉(<机器人QQ号>): ws 消息上报 ws://127.0.0.1:8081/onebot/v11/ws/ {"self_id":<机器人QQ号>,"user_id":<用户QQ号>,"time":1717897432,"message_id":-2147482813,"real_id":-2147482813,"message_seq":-2147482813,"message_type":"group","sender":{"user_id":<用户QQ号>,"nickname":"꧁不̶死̶鸟̶A̶n̶k̶a̶༼༽","card":"","role":"admin"},"raw_message":"rd 3d6","font":14,"sub_type":"normal","message":[{"data":{"text":"rd 3d6"},"type":"text"}],"message_format":"array","post_type":"message","group_id":<QQ群号>}
2024/6/9 09:43:52 亚托莉(<机器人QQ号>): ws 消息上报 {"self_id":<机器人QQ号>,"user_id":<用户QQ号>,"time":1717897432,"message_id":-2147482813,"real_id":-2147482813,"message_seq":-2147482813,"message_type":"group","sender":{"user_id":<用户QQ号>,"nickname":"꧁不̶死̶鸟̶A̶n̶k̶a̶༼༽","card":"","role":"admin"},"raw_message":"rd 3d6","font":14,"sub_type":"normal","message":[{"data":{"text":"rd 3d6"},"type":"text"}],"message_format":"array","post_type":"message","group_id":<QQ群号>}
2024/6/9 09:43:52 亚托莉(<机器人QQ号>): 收到反向Websocket消息 {"action":"send_msg","params":{"user_id":<用户QQ号>,"group_id":<QQ群号>,"message_type":"group","message":[{"type":"text","data":{"text":"你掷出了3个6面骰子, 点数为【8】"}}]},"echo":"7"}
2024/6/9 09:43:52 亚托莉(<机器人QQ号>): 发送消息总大小 0 bytes
2024/6/9 09:43:52 亚托莉(<机器人QQ号>): 设置消息超时时间 5000
2024/6/9 09:43:52 亚托莉(<机器人QQ号>): ws 消息上报 ws://127.0.0.1:8081/onebot/v11/ws/ {"time":1717897432,"self_id":<机器人QQ号>,"post_type":"meta_event","meta_event_type":"heartbeat","status":{"online":true,"good":true},"interval":1000}
2024/6/9 09:43:52 亚托莉(<机器人QQ号>): ws 消息上报 {"time":1717897432,"self_id":<机器人QQ号>,"post_type":"meta_event","meta_event_type":"heartbeat","status":{"online":true,"good":true},"interval":1000}
2024/6/9 09:43:52 亚托莉(<机器人QQ号>): ws 消息上报 ws://127.0.0.1:8081/onebot/v11/ws/ {"time":1717897432,"self_id":<机器人QQ号>,"post_type":"meta_event","meta_event_type":"heartbeat","status":{"online":true,"good":true},"interval":1000}
2024/6/9 09:43:52 亚托莉(<机器人QQ号>): ws 消息上报 {"time":1717897432,"self_id":<机器人QQ号>,"post_type":"meta_event","meta_event_type":"heartbeat","status":{"online":true,"good":true},"interval":1000}
2024/6/9 09:43:53 亚托莉(<机器人QQ号>): message update 7452530323665934133 {"msgId":"7452530323665934133","msgRandom":"52703154","msgSeq":"9335","cntSeq":"0","chatType":2,"msgType":2,"subMsgType":1,"sendType":1,"senderUid":"u_LeZEYWgzMlwucnn88gnoJA","peerUid":"<QQ群号>","channelId":"","guildId":"undefined","guildCode":"0","fromUid":"0","fromAppid":"0","msgTime":"1717897432","msgMeta":"0x","sendStatus":2,"sendRemarkName":"","sendMemberName":"","sendNickName":"亚托莉","guildName":"","channelName":"","elements":[{"elementType":1,"elementId":"7378313290322406462","extBufForUI":"0x","textElement":{"content":"你掷出了3个6面骰子, 点数为【8】","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,"recommendedMsgElement":null,"actionBarElement":null}],"records":[],"emojiLikesList":[],"commentCnt":"0","directMsgFlag":0,"directMsgMembers":[],"peerName":"小Anka、小小不死鸟~","freqLimitInfo":null,"editable":true,"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":"9731","fileGroupSize":null,"foldingInfo":null,"multiTransInfo":null,"senderUin":"<机器人QQ号>","peerUin":"<QQ群号>","msgAttrs":{},"anonymousExtInfo":null,"nameType":0,"avatarFlag":0,"extInfoForUI":null,"personalMedal":null,"categoryManage":0,"msgEventInfo":null}
2024/6/9 09:43:53 亚托莉(<机器人QQ号>): ws 消息上报 ws://127.0.0.1:8081/onebot/v11/ws/ {"time":1717897433,"self_id":<机器人QQ号>,"post_type":"meta_event","meta_event_type":"heartbeat","status":{"online":true,"good":true},"interval":1000}
nonebote端报错信息与之前那个相同。
我确认
D:\Portable-Program-Files\nonebot\LLOneBot
这个路径是我安装nonebot的路径,不是LLOneBot的路径,只是我给nonebot设置的项目名称是LLOneBot
,应该就是nonebot的报错,LLOneBot没有.venv这样的虚拟环境,而且LLOneBot不是Python写的,报错也不应该是这个格式的。 补充一下刚刚重新测试时的LLOneBot端日志:2024/6/9 09:43:52 亚托莉(<机器人QQ号>): ws 消息上报 ws://127.0.0.1:8081/onebot/v11/ws/ {"self_id":<机器人QQ号>,"user_id":<用户QQ号>,"time":1717897432,"message_id":-2147482813,"real_id":-2147482813,"message_seq":-2147482813,"message_type":"group","sender":{"user_id":<用户QQ号>,"nickname":"꧁不̶死̶鸟̶A̶n̶k̶a̶༼༽","card":"","role":"admin"},"raw_message":"rd 3d6","font":14,"sub_type":"normal","message":[{"data":{"text":"rd 3d6"},"type":"text"}],"message_format":"array","post_type":"message","group_id":<QQ群号>} 2024/6/9 09:43:52 亚托莉(<机器人QQ号>): ws 消息上报 {"self_id":<机器人QQ号>,"user_id":<用户QQ号>,"time":1717897432,"message_id":-2147482813,"real_id":-2147482813,"message_seq":-2147482813,"message_type":"group","sender":{"user_id":<用户QQ号>,"nickname":"꧁不̶死̶鸟̶A̶n̶k̶a̶༼༽","card":"","role":"admin"},"raw_message":"rd 3d6","font":14,"sub_type":"normal","message":[{"data":{"text":"rd 3d6"},"type":"text"}],"message_format":"array","post_type":"message","group_id":<QQ群号>} 2024/6/9 09:43:52 亚托莉(<机器人QQ号>): 收到反向Websocket消息 {"action":"send_msg","params":{"user_id":<用户QQ号>,"group_id":<QQ群号>,"message_type":"group","message":[{"type":"text","data":{"text":"你掷出了3个6面骰子, 点数为【8】"}}]},"echo":"7"} 2024/6/9 09:43:52 亚托莉(<机器人QQ号>): 发送消息总大小 0 bytes 2024/6/9 09:43:52 亚托莉(<机器人QQ号>): 设置消息超时时间 5000 2024/6/9 09:43:52 亚托莉(<机器人QQ号>): ws 消息上报 ws://127.0.0.1:8081/onebot/v11/ws/ {"time":1717897432,"self_id":<机器人QQ号>,"post_type":"meta_event","meta_event_type":"heartbeat","status":{"online":true,"good":true},"interval":1000} 2024/6/9 09:43:52 亚托莉(<机器人QQ号>): ws 消息上报 {"time":1717897432,"self_id":<机器人QQ号>,"post_type":"meta_event","meta_event_type":"heartbeat","status":{"online":true,"good":true},"interval":1000} 2024/6/9 09:43:52 亚托莉(<机器人QQ号>): ws 消息上报 ws://127.0.0.1:8081/onebot/v11/ws/ {"time":1717897432,"self_id":<机器人QQ号>,"post_type":"meta_event","meta_event_type":"heartbeat","status":{"online":true,"good":true},"interval":1000} 2024/6/9 09:43:52 亚托莉(<机器人QQ号>): ws 消息上报 {"time":1717897432,"self_id":<机器人QQ号>,"post_type":"meta_event","meta_event_type":"heartbeat","status":{"online":true,"good":true},"interval":1000} 2024/6/9 09:43:53 亚托莉(<机器人QQ号>): message update 7452530323665934133 {"msgId":"7452530323665934133","msgRandom":"52703154","msgSeq":"9335","cntSeq":"0","chatType":2,"msgType":2,"subMsgType":1,"sendType":1,"senderUid":"u_LeZEYWgzMlwucnn88gnoJA","peerUid":"<QQ群号>","channelId":"","guildId":"undefined","guildCode":"0","fromUid":"0","fromAppid":"0","msgTime":"1717897432","msgMeta":"0x","sendStatus":2,"sendRemarkName":"","sendMemberName":"","sendNickName":"亚托莉","guildName":"","channelName":"","elements":[{"elementType":1,"elementId":"7378313290322406462","extBufForUI":"0x","textElement":{"content":"你掷出了3个6面骰子, 点数为【8】","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,"recommendedMsgElement":null,"actionBarElement":null}],"records":[],"emojiLikesList":[],"commentCnt":"0","directMsgFlag":0,"directMsgMembers":[],"peerName":"小Anka、小小不死鸟~","freqLimitInfo":null,"editable":true,"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":"9731","fileGroupSize":null,"foldingInfo":null,"multiTransInfo":null,"senderUin":"<机器人QQ号>","peerUin":"<QQ群号>","msgAttrs":{},"anonymousExtInfo":null,"nameType":0,"avatarFlag":0,"extInfoForUI":null,"personalMedal":null,"categoryManage":0,"msgEventInfo":null} 2024/6/9 09:43:53 亚托莉(<机器人QQ号>): ws 消息上报 ws://127.0.0.1:8081/onebot/v11/ws/ {"time":1717897433,"self_id":<机器人QQ号>,"post_type":"meta_event","meta_event_type":"heartbeat","status":{"online":true,"good":true},"interval":1000}
nonebote端报错信息与之前那个相同。
你没听懂吗,"发送超时",这个错误信息是来自api请求的响应的状态码
你要是不知道什么叫做ob的接口状态码,建议直接去llob问linyuchen
操作系统
Windows
Python 版本
3.11.8
NoneBot 版本
2.3.1
适配器
OneBot11 2.4.3
协议端
LLOneBot 3.26.5
描述问题
正向ws和反向ws均尝试过连接,且现象相同: 不安装任何插件时,在运行日志中看到所有消息接收均正常,一旦安装了插件且消息触发了插件回复就会报错“发送超时”,但实际上,当消息是文本且文本字数较少时能够在QQ上看到消息确实发出来了,而当文本较长或是图片、音频等除文本以外的消息时,报错相同,而QQ中看不到消息。
复现步骤
nonebot的安装遵照文档进行。 LLOneBot的安装也完全遵照其文档进行。 反向ws使用nonebot文档中的配置
正向ws使用onebot适配器文档中的配置
ONEBOT_WS_URLS=["ws://127.0.0.1:6700"]
对应的LLOneBot配置如下图配置完成后启动nonebot,看到日志输出协议端连接成功,然后在QQ中发送指令,之后就出现报错。 在之后不断的尝试中发现虽然报错,但QQ中能收到短文本消息,收不到长文本或图片、音频等特殊类型的消息。
期望的结果
正常发送各类消息(包括但不限于文本、图片、语音等)
截图或日志
报错时的日志:
LiteLoader版本信息及扩展安装情况截图: