From 169ae6a4d09b948b3f49ae6f76823b59836a3e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Tue, 15 Oct 2024 09:11:00 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E8=A7=84=E8=8C=83=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/apis/file.ts | 4 ++-- src/core/entities/user.ts | 4 ++-- src/core/services/NodeIKernelECDHService.ts | 1 + src/onebot/cqcode.ts | 10 ++++++---- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/core/apis/file.ts b/src/core/apis/file.ts index ae1e1a9d..3ce58117 100644 --- a/src/core/apis/file.ts +++ b/src/core/apis/file.ts @@ -387,8 +387,8 @@ export class NTQQFileApi { rkeyData.online_rkey = true; } } - } catch (error) { - + } catch (error: any) { + this.context.logger.logError.bind(this.context.logger)('获取rkey失败', error.message); } if (!rkeyData.online_rkey) { diff --git a/src/core/entities/user.ts b/src/core/entities/user.ts index c71733b9..6730ab5a 100644 --- a/src/core/entities/user.ts +++ b/src/core/entities/user.ts @@ -288,9 +288,9 @@ export interface User { export interface SelfInfo extends User { online?: boolean; } +export type Friend = User; -export interface Friend extends User { -} +// 本来是 Friend extends User 现在用不到 export enum BizKey { KPRIVILEGEICON, diff --git a/src/core/services/NodeIKernelECDHService.ts b/src/core/services/NodeIKernelECDHService.ts index fd8231a3..bf8af076 100644 --- a/src/core/services/NodeIKernelECDHService.ts +++ b/src/core/services/NodeIKernelECDHService.ts @@ -1,2 +1,3 @@ export interface NodeIKernelECDHService { + sendOIDBECRequest: (data: Uint8Array) => Promise; } diff --git a/src/onebot/cqcode.ts b/src/onebot/cqcode.ts index 9c830166..e2f0152b 100644 --- a/src/onebot/cqcode.ts +++ b/src/onebot/cqcode.ts @@ -15,10 +15,12 @@ function from(source: string) { if (!capture) return null; const [, type, attrs] = capture; const data: Record = {}; - attrs && attrs.slice(1).split(',').forEach((str) => { - const index = str.indexOf('='); - data[str.slice(0, index)] = unescape(str.slice(index + 1)); - }); + if (attrs) { + attrs.slice(1).split(',').forEach((str) => { + const index = str.indexOf('='); + data[str.slice(0, index)] = unescape(str.slice(index + 1)); + }); + } return { type, data, capture }; }