Closed Numendacil closed 2 years ago
当不使用UploadVoice而是直接填入Url/Path/Id属性发送语音时,由于length_变量未设置初始值将随机取值。虽然mirai-api-http那边的文档说不看length属性,但好像有概率length的上限超过了那边能接收的最大值从而返回 {"code": 400, “msg": "无效参数"}
验证方式:查看发送失败的请求内容为 { "sessionKey": "xxxx" "target": "xxxx" "messageChain": [{ "base64": "" "length": 16582373882432544079 "path": "path/to/amr" "type": "Voice" "url": "" "voiceId": "" }] } 此时mirai-api-http返回{"code":400, "msg":"无效参数"} 把length属性改为较小值,例如 { "sessionKey": "xxxx" "target": "xxxx" "messageChain": [{ "base64": "" "length": 100 "path": "path/to/amr" "type": "Voice" "url": "" "voiceId": "" }] } 则可以成功发送,返回{"code":0,"msg":"success","messageId":402}
mirai版本: 2.8.0-M1 mirai-http-api版本: 2.3.1
当不使用UploadVoice而是直接填入Url/Path/Id属性发送语音时,由于length_变量未设置初始值将随机取值。虽然mirai-api-http那边的文档说不看length属性,但好像有概率length的上限超过了那边能接收的最大值从而返回 {"code": 400, “msg": "无效参数"}
验证方式:查看发送失败的请求内容为 { "sessionKey": "xxxx" "target": "xxxx" "messageChain": [{ "base64": "" "length": 16582373882432544079 "path": "path/to/amr" "type": "Voice" "url": "" "voiceId": "" }] } 此时mirai-api-http返回{"code":400, "msg":"无效参数"} 把length属性改为较小值,例如 { "sessionKey": "xxxx" "target": "xxxx" "messageChain": [{ "base64": "" "length": 100 "path": "path/to/amr" "type": "Voice" "url": "" "voiceId": "" }] } 则可以成功发送,返回{"code":0,"msg":"success","messageId":402}
mirai版本: 2.8.0-M1 mirai-http-api版本: 2.3.1