Skip to content

Commit 3ca5c60

Browse files
authored
Merge pull request #759 from LLOneBot/dev
chore: update version to 7.12.12
2 parents a5d9d2f + 4022fe7 commit 3ca5c60

3 files changed

Lines changed: 39 additions & 18 deletions

File tree

doc/更新日志.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
V7.12.12
2+
更新时间 2026-05-05
3+
4+
* OneBot 修复 get_forward_msg API 获取包含视频的聊天记录时报错
5+
* OneBot 修复设置事件过滤器后导致反向 WS 频繁断线重连
6+
7+
=================
18
V7.12.11
29
更新时间 2026-05-03
310

src/onebot11/connect/ws.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ class OB11WebSocket {
181181

182182
const disposeHeartBeat = this.ctx.interval(() => {
183183
const event = new OB11HeartbeatEvent(selfInfo.online!, true, this.config.heartInterval)
184-
if (!matchEventFilter(this.config.filter, event)) return
185184
this.reply(socket, event)
186185
}, this.config.heartInterval)
187186

@@ -337,7 +336,6 @@ class OB11WebSocketReverse {
337336
const disposeHeartBeat = this.ctx.interval(() => {
338337
if (this.wsClient) {
339338
const event = new OB11HeartbeatEvent(selfInfo.online!, true, this.config.heartInterval)
340-
if (!matchEventFilter(this.config.filter, event)) return
341339
this.reply(this.wsClient, event)
342340
}
343341
}, this.config.heartInterval)

src/onebot11/helper/decodeMultiMessage.ts

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,38 @@ export async function decodeMultiMessage(ctx: Context, items: InferProtoModel<ty
1717
text: element.text.str!
1818
}
1919
}
20-
} else if (element.commonElem && element.commonElem.serviceType === 48) {
21-
const richMediaInfo = Media.MsgInfo.decode(element.commonElem.pbElem)
22-
const infoBody = richMediaInfo.msgInfoBody[0]
23-
const parsedUrl = new URL('https://' + infoBody.pic!.domain + infoBody.pic!.urlPath + infoBody.pic!.ext!.originalParam)
24-
const imageAppid = parsedUrl.searchParams.get('appid')
25-
const rkeyData = await ctx.ntFileApi.rkeyManager.getRkey()
26-
const url = parsedUrl.href + (imageAppid === '1406' ? rkeyData.private_rkey : rkeyData.group_rkey)
27-
const { info } = richMediaInfo.msgInfoBody[0].index!
28-
const { pic } = richMediaInfo.extBizInfo!
29-
segment = {
30-
type: OB11MessageDataType.Image,
31-
data: {
32-
file: info!.fileName!,
33-
subType: pic!.bizType!,
34-
url,
35-
file_size: info!.fileSize!.toString(),
20+
} else if (element.commonElem) {
21+
const { businessType, serviceType, pbElem } = element.commonElem
22+
if (serviceType === 48 && (businessType === 10 || businessType === 20)) {
23+
const richMediaInfo = Media.MsgInfo.decode(pbElem)
24+
const infoBody = richMediaInfo.msgInfoBody[0]
25+
const parsedUrl = new URL('https://' + infoBody.pic!.domain + infoBody.pic!.urlPath + infoBody.pic!.ext!.originalParam)
26+
const imageAppid = parsedUrl.searchParams.get('appid')
27+
const rkeyData = await ctx.ntFileApi.rkeyManager.getRkey()
28+
const url = parsedUrl.href + (imageAppid === '1406' ? rkeyData.private_rkey : rkeyData.group_rkey)
29+
const { info } = richMediaInfo.msgInfoBody[0].index!
30+
const { pic } = richMediaInfo.extBizInfo!
31+
segment = {
32+
type: OB11MessageDataType.Image,
33+
data: {
34+
file: info!.fileName!,
35+
subType: pic!.bizType!,
36+
url,
37+
file_size: info!.fileSize!.toString(),
38+
}
39+
}
40+
} else if (serviceType === 48 && (businessType === 11 || businessType === 21)) {
41+
const { msgInfoBody } = Media.MsgInfo.decode(pbElem)
42+
const { index } = msgInfoBody[0]
43+
const url = await ctx.ntFileApi.getVideoUrlByPacket(index.fileUuid, businessType === 21)
44+
segment = {
45+
type: OB11MessageDataType.Video,
46+
data: {
47+
file: index.info.fileName,
48+
url,
49+
path: '',
50+
file_size: index.info.fileSize.toString(),
51+
}
3652
}
3753
}
3854
}

0 commit comments

Comments
 (0)