Skip to content

Commit e3955e4

Browse files
修复 onebot v11 无法发送图片的bug
发送图片时, msg 内容为 ``` {"type": "image", "data": {"file": "base64://iVBIJ...=", "type": null, "cache": "true", "proxy": "true", "timeout": null}} ``` data里也有个type字段,如果把type字段放最前面,后面的 ...data 展开会用 null 覆盖前面的 image, 导致图片发送失败
1 parent 60e79d6 commit e3955e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export function fromSegment(msgList:SegmentElem|SegmentElem[]):MessageElem[]{
179179
msgList=[].concat(msgList)
180180
return msgList.map(msg=>{
181181
const {type,data,...other}=msg
182-
return {type,...other,...data} as MessageElem
182+
return {...other,...data,type} as MessageElem
183183
})
184184

185185
}

0 commit comments

Comments
 (0)