From 461436ed715e459036d780433be55e812c6ba6a3 Mon Sep 17 00:00:00 2001 From: idranme <96647698+idranme@users.noreply.github.com> Date: Sat, 2 May 2026 20:47:33 +0800 Subject: [PATCH 1/4] chore --- src/ntqqapi/services/NodeIKernelMsgService.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/ntqqapi/services/NodeIKernelMsgService.ts b/src/ntqqapi/services/NodeIKernelMsgService.ts index 9ceb37236..dc3ecffae 100644 --- a/src/ntqqapi/services/NodeIKernelMsgService.ts +++ b/src/ntqqapi/services/NodeIKernelMsgService.ts @@ -168,4 +168,20 @@ export interface NodeIKernelMsgService { setContactLocalTop(peer: Peer, isTop: boolean): Promise sendShowInputStatusReq(chatType: ChatType, eventType: number, toUid: string): Promise + + clickInlineKeyboardButton(inlineKeyboardClickInfo: { + guildId: string + dmFlag: number + peerId: string + chatType: ChatType + botAppid: string + msgSeq: string + buttonId: string + callback_data: string + }): Promise } From f748d89cd01c64f573bdafd8076822591579d690 Mon Sep 17 00:00:00 2001 From: idranme <96647698+idranme@users.noreply.github.com> Date: Sun, 3 May 2026 10:17:59 +0800 Subject: [PATCH 2/4] refactor --- src/onebot11/entities.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/onebot11/entities.ts b/src/onebot11/entities.ts index f1e2a0120..78ecfeb66 100644 --- a/src/onebot11/entities.ts +++ b/src/onebot11/entities.ts @@ -274,12 +274,16 @@ export namespace OB11Entities { } else { operatorUin = await ctx.ntUserApi.getUinByUid(revokeElement.operatorUid) } - if (msg.senderUin === '0' || !msg.senderUin) { - ctx.logger.warn(`发生异常 senderUin: ${msg.senderUin}`) + let senderUin = msg.senderUin + if (msg.senderUin === '0') { + senderUin = await ctx.ntUserApi.getUinByUid(revokeElement.origMsgSenderUid) + if (revokeElement.operatorUid === revokeElement.origMsgSenderUid) { + operatorUin = senderUin + } } return new OB11GroupRecallNoticeEvent( Number(msg.peerUid), - Number(msg.senderUin), + Number(senderUin), Number(operatorUin), shortId, ) From 5ce9336276e784aef4090b250bab5a41133ad7b1 Mon Sep 17 00:00:00 2001 From: idranme <96647698+idranme@users.noreply.github.com> Date: Sun, 3 May 2026 16:51:49 +0800 Subject: [PATCH 3/4] fix --- src/main/pmhq/mixins/message.ts | 4 +++- src/onebot11/action/llbot/msg/SendGroupAiRecord.ts | 13 +++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/pmhq/mixins/message.ts b/src/main/pmhq/mixins/message.ts index 7e35fee78..de233900a 100644 --- a/src/main/pmhq/mixins/message.ts +++ b/src/main/pmhq/mixins/message.ts @@ -63,15 +63,17 @@ export function MessageMixin PMHQBase>(Base: T } async getGroupGenerateAiRecord(groupId: number, character: string, text: string, chatType: number) { + const msgRandom = randomBytes(4).readUInt32BE(0) const body = Oidb.GetGroupGenerateAiRecordReq.encode({ groupId, voiceId: character, text, chatType, - clientMsgInfo: { msgRandom: randomBytes(4).readUInt32BE(0) }, + clientMsgInfo: { msgRandom }, }) const data = Oidb.Base.encode({ command: 0x929b, subCommand: 0, body }) await this.httpSendPB('OidbSvcTrpcTcp.0x929b_0', data) + return { msgRandom } } } } diff --git a/src/onebot11/action/llbot/msg/SendGroupAiRecord.ts b/src/onebot11/action/llbot/msg/SendGroupAiRecord.ts index 965fc82a2..c4c29ecff 100644 --- a/src/onebot11/action/llbot/msg/SendGroupAiRecord.ts +++ b/src/onebot11/action/llbot/msg/SendGroupAiRecord.ts @@ -22,7 +22,16 @@ export class SendGroupAiRecord extends BaseAction { }) async _handle(payload: Payload) { - await this.ctx.pmhq.getGroupGenerateAiRecord(+payload.group_id, payload.character, payload.text, +payload.chat_type) - return { message_id: 0 } + const res = await this.ctx.pmhq.getGroupGenerateAiRecord(+payload.group_id, payload.character, payload.text, +payload.chat_type) + const targetMsgRandom = res.msgRandom.toString() + const { promise, resolve } = Promise.withResolvers() + const dispose = this.ctx.on('nt/message-created', (msg) => { + if (msg.msgRandom === targetMsgRandom) { + dispose() + const shortId = this.ctx.store.createMsgShortId(msg) + resolve({ message_id: shortId }) + } + }) + return promise } } From d5f363f14c4149fc43c25278b75f2556297ad0b8 Mon Sep 17 00:00:00 2001 From: idranme <96647698+idranme@users.noreply.github.com> Date: Sun, 3 May 2026 17:03:58 +0800 Subject: [PATCH 4/4] chore: update version to 7.12.11 --- "doc/\346\233\264\346\226\260\346\227\245\345\277\227.txt" | 6 ++++++ package-dist.json | 2 +- src/version.ts | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git "a/doc/\346\233\264\346\226\260\346\227\245\345\277\227.txt" "b/doc/\346\233\264\346\226\260\346\227\245\345\277\227.txt" index 75f862dc7..9b092767a 100644 --- "a/doc/\346\233\264\346\226\260\346\227\245\345\277\227.txt" +++ "b/doc/\346\233\264\346\226\260\346\227\245\345\277\227.txt" @@ -1,3 +1,9 @@ +V7.12.11 +更新时间 2026-05-03 + +* OneBot 修复 send_group_ai_record API 返回无效的 message_id + +================= V7.12.10 更新时间 2026-04-30 diff --git a/package-dist.json b/package-dist.json index 73dab60a5..269348be5 100644 --- a/package-dist.json +++ b/package-dist.json @@ -1 +1 @@ -{"name":"llonebot-dist","version":"7.12.10","type":"module","description":"","main":"llbot.js","author":"linyuchen","repository":{"type":"git","url":"https://github.com/LLOneBot/LuckyLilliaBot"}} \ No newline at end of file +{"name":"llonebot-dist","version":"7.12.11","type":"module","description":"","main":"llbot.js","author":"linyuchen","repository":{"type":"git","url":"https://github.com/LLOneBot/LuckyLilliaBot"}} \ No newline at end of file diff --git a/src/version.ts b/src/version.ts index 1ee4a8853..22ac7de6f 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const version = '7.12.10' +export const version = '7.12.11'