From b669e28038fe97c675d2a53a8fd388d9a326f33b Mon Sep 17 00:00:00 2001 From: idranme <96647698+idranme@users.noreply.github.com> Date: Sat, 26 Oct 2024 18:04:23 +0800 Subject: [PATCH] fix --- package.json | 4 ++-- src/main/main.ts | 4 ++-- src/ntqqapi/api/file.ts | 2 +- src/ntqqapi/hook.ts | 10 ++++++---- src/onebot11/entities.ts | 7 +++++++ 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 44fc231..2be116a 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "fluent-ffmpeg": "^2.1.3", "minato": "^3.6.0", "protobufjs": "^7.4.0", - "silk-wasm": "^3.6.1", + "silk-wasm": "^3.6.3", "ts-case-convert": "^2.1.0", "ws": "^8.18.0" }, @@ -42,7 +42,7 @@ "electron-vite": "^2.3.0", "protobufjs-cli": "^1.1.3", "typescript": "^5.6.3", - "vite": "^5.4.9", + "vite": "^5.4.10 ", "vite-plugin-cp": "^4.0.8" }, "packageManager": "yarn@4.5.1" diff --git a/src/main/main.ts b/src/main/main.ts index 964260d..d5651be 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -185,7 +185,7 @@ function onLoad() { if (config.enableLLOB && (config.satori.enable || config.ob11.enable)) { startHook() - await ctx.sleep(550) + await ctx.sleep(600) } else { llonebotError.otherError = 'LLOneBot 未启动' log('LLOneBot 开关设置为关闭,不启动 LLOneBot') @@ -225,7 +225,7 @@ function onLoad() { started = true llonebotError.otherError = '' } - }, 600) + }, 500) } // 创建窗口时触发 diff --git a/src/ntqqapi/api/file.ts b/src/ntqqapi/api/file.ts index 1768fd6..6404a07 100644 --- a/src/ntqqapi/api/file.ts +++ b/src/ntqqapi/api/file.ts @@ -43,7 +43,7 @@ export class NTQQFileApi extends Service { msgId, elemId: elementId, videoCodecFormat: 0, - params: { + exParams: { downSourceType: 1, triggerType: 1 } diff --git a/src/ntqqapi/hook.ts b/src/ntqqapi/hook.ts index 104cfbe..1c57bed 100644 --- a/src/ntqqapi/hook.ts +++ b/src/ntqqapi/hook.ts @@ -70,10 +70,12 @@ export function startHook() { delete hookApiCallbacks[callbackId] } } else if (args[2]) { - for (const receiveData of args[2]) { - for (const hook of receiveHooks.values()) { - if (hook.method.includes(receiveData.cmdName)) { - Promise.resolve(hook.hookFunc(receiveData.payload)) + if (['IPC_DOWN_2', 'IPC_DOWN_3'].includes(args[0])) { + for (const receiveData of args[2]) { + for (const hook of receiveHooks.values()) { + if (hook.method.includes(receiveData.cmdName)) { + Promise.resolve(hook.hookFunc(receiveData.payload)) + } } } } diff --git a/src/onebot11/entities.ts b/src/onebot11/entities.ts index 1f6b485..1e4ec0b 100644 --- a/src/onebot11/entities.ts +++ b/src/onebot11/entities.ts @@ -478,6 +478,13 @@ export namespace OB11Entities { ) } } + else if (groupElement.type === TipGroupElementType.MemberIncrease) { + const { memberUid, adminUid } = groupElement + if (memberUid !== selfInfo.uid) return + ctx.logger.info('收到群成员增加消息', groupElement) + const adminUin = adminUid ? await ctx.ntUserApi.getUinByUid(adminUid) : selfInfo.uin + return new OB11GroupIncreaseEvent(+msg.peerUid, +selfInfo.uin, +adminUin) + } } else if (element.fileElement) { return new OB11GroupUploadNoticeEvent(+msg.peerUid, +msg.senderUin!, {