diff --git a/manifest.json b/manifest.json index 452576b..f7bc811 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "name": "LLOneBot", "slug": "LLOneBot", "description": "实现 OneBot 11 和 Satori 协议,用于 QQ 机器人开发", - "version": "4.2.1", + "version": "4.2.2", "icon": "./icon.webp", "authors": [ { diff --git a/src/ntqqapi/hook.ts b/src/ntqqapi/hook.ts index eb36206..9443019 100644 --- a/src/ntqqapi/hook.ts +++ b/src/ntqqapi/hook.ts @@ -58,14 +58,14 @@ export function startHook() { event.sender[senderExclude] = true event.sender.send = new Proxy(event.sender.send, { apply(target, thisArg, args: [channel: string, meta: Dict, data: Dict[]]) { - if (args[1].eventName?.startsWith('ns-LoggerApi')) { + if (args[1]?.eventName?.startsWith('ns-LoggerApi')) { return target.apply(thisArg, args) } if (logHook) { log('received', args) } - const callbackId = args[1].callbackId + const callbackId = args[1]?.callbackId if (callbackId) { if (hookApiCallbacks[callbackId]) { Promise.resolve(hookApiCallbacks[callbackId](args[2])) @@ -97,7 +97,7 @@ export function startHook() { } } return target.apply(thisArg, args) - } + }, }) } diff --git a/src/version.ts b/src/version.ts index 6563972..9c9f404 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const version = '4.2.1' +export const version = '4.2.2'