From c635da7ebb889f2a93ee9387fd9804a683d1c656 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: Sun, 8 Sep 2024 10:10:47 +0800 Subject: [PATCH] style: lint --- src/common/helper.ts | 8 ++++---- src/common/qq-basic-info.ts | 24 ++++++++++++------------ src/core/apis/group.ts | 4 ++-- src/core/apis/webapi.ts | 4 ++-- src/onebot/action/file/GetFile.ts | 4 ++-- src/onebot/api/msg.ts | 2 +- src/shell/napcat.ts | 2 +- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/common/helper.ts b/src/common/helper.ts index a8728e73..fcfd5a96 100644 --- a/src/common/helper.ts +++ b/src/common/helper.ts @@ -26,9 +26,9 @@ export async function solveAsyncProblem Promise { + const data = await solveAsyncProblem((eventWrapper: NTEventWrapper, GroupCode: string, uid: string, forced = false) => { return eventWrapper.callNormalEventV2( 'NodeIKernelGroupService/getMemberInfo', 'NodeIKernelGroupListener/onMemberInfoChange', @@ -278,7 +278,7 @@ export class NTQQGroupApi { return data[3].get(uid); } if (retry > 0) { - let trydata = await this.getGroupMemberEx(GroupCode, uid, true, retry - 1) as GroupMember | undefined; + const trydata = await this.getGroupMemberEx(GroupCode, uid, true, retry - 1) as GroupMember | undefined; if (trydata) return trydata; } return undefined; diff --git a/src/core/apis/webapi.ts b/src/core/apis/webapi.ts index 9a0695ec..243b93b8 100644 --- a/src/core/apis/webapi.ts +++ b/src/core/apis/webapi.ts @@ -157,7 +157,7 @@ export class NTQQWebApi { const cookieObject = await this.core.apis.UserApi.getCookies('qun.qq.com'); try { - let settings = JSON.stringify({ + const settings = JSON.stringify({ is_show_edit_card: is_show_edit_card, tip_window_type: tip_window_type, confirm_required: confirm_required @@ -167,7 +167,7 @@ export class NTQQWebApi { imgWidth: imgWidth.toString(), imgHeight: imgHeight.toString(), }; - let ret: SetNoticeRetSuccess = await RequestUtil.HttpGetJson( + const ret: SetNoticeRetSuccess = await RequestUtil.HttpGetJson( `https://web.qun.qq.com/cgi-bin/announce/add_qun_notice?${new URLSearchParams({ bkn: this.getBknFromCookie(cookieObject), qid: GroupCode, diff --git a/src/onebot/action/file/GetFile.ts b/src/onebot/action/file/GetFile.ts index 77790b45..40f705ca 100644 --- a/src/onebot/action/file/GetFile.ts +++ b/src/onebot/action/file/GetFile.ts @@ -43,12 +43,12 @@ export class GetFileBase extends BaseAction { const fileName = mixElementInner.fileName ?? ''; let url = ''; if (mixElement?.picElement && rawMessage) { - let tempData = + const tempData = await this.obContext.apis.MsgApi.rawToOb11Converters.picElement?.(mixElement?.picElement, rawMessage, mixElement) as OB11MessageImage | undefined; url = tempData?.data.url ?? ''; } if (mixElement?.videoElement && rawMessage) { - let tempData = + const tempData = await this.obContext.apis.MsgApi.rawToOb11Converters.videoElement?.(mixElement?.videoElement, rawMessage, mixElement) as OB11MessageVideo | undefined; url = tempData?.data.url ?? ''; } diff --git a/src/onebot/api/msg.ts b/src/onebot/api/msg.ts index 21757111..a5691719 100644 --- a/src/onebot/api/msg.ts +++ b/src/onebot/api/msg.ts @@ -209,7 +209,7 @@ export class OneBotMsgApi { if (records.peerUin === '284840486') { return createReplyData(records.msgId); } - let replyMsg = (await this.core.apis.MsgApi.queryMsgsWithFilterExWithSeqV2(peer, element.replayMsgSeq, element.replyMsgTime, [element.senderUidStr])) + const replyMsg = (await this.core.apis.MsgApi.queryMsgsWithFilterExWithSeqV2(peer, element.replayMsgSeq, element.replyMsgTime, [element.senderUidStr])) .msgList.find(msg => msg.msgRandom === records.msgRandom); if (!replyMsg || records.msgRandom !== replyMsg.msgRandom) { diff --git a/src/shell/napcat.ts b/src/shell/napcat.ts index 1a2a704b..0f9e11b9 100644 --- a/src/shell/napcat.ts +++ b/src/shell/napcat.ts @@ -199,7 +199,7 @@ export async function NCoreInitShell() { logger.log(`可用于快速登录的 QQ:\n${historyLoginList .map((u, index) => `${index + 1}. ${u.uin} ${u.nickName}`) .join('\n') - }`); + }`); } loginService.getQRCodePicture(); }