From 44ff92ad4b271fb44786b690b6747d1096c446fd 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, 17 Dec 2024 09:25:10 +0800 Subject: [PATCH] style: lint --- src/core/apis/group.ts | 2 +- src/onebot/action/group/GetGroupInfo.ts | 2 +- src/onebot/action/group/SendGroupMsg.ts | 2 +- src/onebot/action/msg/SendPrivateMsg.ts | 2 +- src/onebot/action/system/CanSendImage.ts | 2 +- src/onebot/api/msg.ts | 36 ++++++++++++------------ src/onebot/api/quick-action.ts | 2 +- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/core/apis/group.ts b/src/core/apis/group.ts index f412936e0..ad5fe2544 100644 --- a/src/core/apis/group.ts +++ b/src/core/apis/group.ts @@ -26,7 +26,7 @@ export class NTQQGroupApi { } async fetchGroupDetail(groupCode: string) { - let [, detailInfo] = await this.core.eventWrapper.callNormalEventV2( + const [, detailInfo] = await this.core.eventWrapper.callNormalEventV2( 'NodeIKernelGroupService/getGroupDetailInfo', 'NodeIKernelGroupListener/onGroupDetailInfoChange', [groupCode, GroupInfoSource.KDATACARD], diff --git a/src/onebot/action/group/GetGroupInfo.ts b/src/onebot/action/group/GetGroupInfo.ts index b4f7fda60..cb38ca04b 100644 --- a/src/onebot/action/group/GetGroupInfo.ts +++ b/src/onebot/action/group/GetGroupInfo.ts @@ -24,7 +24,7 @@ class GetGroupInfo extends OneBotAction { group_name: data.groupName, member_count: data.memberNum, max_member_count: data.maxMemberNum, - } + }; } return OB11Construct.group(group); } diff --git a/src/onebot/action/group/SendGroupMsg.ts b/src/onebot/action/group/SendGroupMsg.ts index 5345f4bb0..c0723e417 100644 --- a/src/onebot/action/group/SendGroupMsg.ts +++ b/src/onebot/action/group/SendGroupMsg.ts @@ -1,4 +1,4 @@ -import {ContextMode, SendMsgBase} from '@/onebot/action/msg/SendMsg'; +import { ContextMode, SendMsgBase } from '@/onebot/action/msg/SendMsg'; import { ActionName, BaseCheckResult } from '@/onebot/action/router'; import { OB11PostSendMsg } from '@/onebot/types'; diff --git a/src/onebot/action/msg/SendPrivateMsg.ts b/src/onebot/action/msg/SendPrivateMsg.ts index 0b6d9ee1c..fa2775a92 100644 --- a/src/onebot/action/msg/SendPrivateMsg.ts +++ b/src/onebot/action/msg/SendPrivateMsg.ts @@ -1,4 +1,4 @@ -import {ContextMode, SendMsgBase} from './SendMsg'; +import { ContextMode, SendMsgBase } from './SendMsg'; import { ActionName, BaseCheckResult } from '@/onebot/action/router'; import { OB11PostSendMsg } from '@/onebot/types'; diff --git a/src/onebot/action/system/CanSendImage.ts b/src/onebot/action/system/CanSendImage.ts index 5ffd73c17..ecf4fca4a 100644 --- a/src/onebot/action/system/CanSendImage.ts +++ b/src/onebot/action/system/CanSendImage.ts @@ -1,5 +1,5 @@ import { ActionName } from '@/onebot/action/router'; -import CanSendRecord, {CanSend} from './CanSendRecord'; +import CanSendRecord, { CanSend } from './CanSendRecord'; interface ReturnType { yes: boolean; diff --git a/src/onebot/api/msg.ts b/src/onebot/api/msg.ts index f951b2e2e..ecf4fc7d6 100644 --- a/src/onebot/api/msg.ts +++ b/src/onebot/api/msg.ts @@ -895,16 +895,16 @@ export class OneBotMsgApi { const calculateTotalSize = async (elements: SendMessageElement[]): Promise => { const sizePromises = elements.map(async element => { switch (element.elementType) { - case ElementType.PTT: - return (await fsPromise.stat(element.pttElement.filePath)).size; - case ElementType.FILE: - return (await fsPromise.stat(element.fileElement.filePath)).size; - case ElementType.VIDEO: - return (await fsPromise.stat(element.videoElement.filePath)).size; - case ElementType.PIC: - return (await fsPromise.stat(element.picElement.sourcePath)).size; - default: - return 0; + case ElementType.PTT: + return (await fsPromise.stat(element.pttElement.filePath)).size; + case ElementType.FILE: + return (await fsPromise.stat(element.fileElement.filePath)).size; + case ElementType.VIDEO: + return (await fsPromise.stat(element.videoElement.filePath)).size; + case ElementType.PIC: + return (await fsPromise.stat(element.picElement.sourcePath)).size; + default: + return 0; } }); const sizes = await Promise.all(sizePromises); @@ -970,14 +970,14 @@ export class OneBotMsgApi { } groupChangDecreseType2String(type: number): GroupDecreaseSubType { switch (type) { - case 130: - return 'leave'; - case 131: - return 'kick'; - case 3: - return 'kick_me'; - default: - return 'kick'; + case 130: + return 'leave'; + case 131: + return 'kick'; + case 3: + return 'kick_me'; + default: + return 'kick'; } } diff --git a/src/onebot/api/quick-action.ts b/src/onebot/api/quick-action.ts index 5a66c858a..d4d4f6e15 100644 --- a/src/onebot/api/quick-action.ts +++ b/src/onebot/api/quick-action.ts @@ -91,7 +91,7 @@ export class OneBotQuickActionApi { } async handleGroupRequest(request: OB11GroupRequestEvent, quickAction: QuickActionGroupRequest) { - let noify = await this.findNotify(request.flag); + const noify = await this.findNotify(request.flag); if (!isNull(quickAction.approve) && noify) { this.core.apis.GroupApi.handleGroupRequest(