From 6384b50bae335e100b2c7367f8f78dd8ef1e58d0 Mon Sep 17 00:00:00 2001 From: Seijo Cecilia Date: Tue, 27 Aug 2024 13:35:25 +0800 Subject: [PATCH] chore: run eslint --- src/onebot/action/go-cqhttp/GetFriendMsgHistory.ts | 4 ++-- src/onebot/action/go-cqhttp/GetGroupMsgHistory.ts | 4 ++-- src/onebot/action/go-cqhttp/SendGroupNotice.ts | 5 ++--- src/shell/napcat.ts | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/onebot/action/go-cqhttp/GetFriendMsgHistory.ts b/src/onebot/action/go-cqhttp/GetFriendMsgHistory.ts index 4100bf22..732acc48 100644 --- a/src/onebot/action/go-cqhttp/GetFriendMsgHistory.ts +++ b/src/onebot/action/go-cqhttp/GetFriendMsgHistory.ts @@ -1,7 +1,7 @@ import BaseAction from '../BaseAction'; import { OB11Message } from '@/onebot'; import { ActionName } from '../types'; -import { ChatType, Peer, RawMessage } from '@/core/entities'; +import { ChatType } from '@/core/entities'; import { FromSchema, JSONSchema } from 'json-schema-to-ts'; import { MessageUnique } from '@/common/message-unique'; @@ -40,7 +40,7 @@ export default class GetFriendMsgHistory extends BaseAction { const hasMessageSeq = !payload.message_seq ? !!payload.message_seq : !(payload.message_seq?.toString() === '' || payload.message_seq?.toString() === '0'); //拉取消息 const startMsgId = hasMessageSeq ? (MessageUnique.getMsgIdAndPeerByShortId(+payload.message_seq!)?.MsgId ?? payload.message_seq!.toString()) : '0'; - let msgList = hasMessageSeq ? + const msgList = hasMessageSeq ? (await NTQQMsgApi.getMsgHistory(peer, startMsgId, MsgCount)).msgList : (await NTQQMsgApi.getAioFirstViewLatestMsgs(peer, MsgCount)).msgList; if (msgList.length === 0) throw `消息${payload.message_seq}不存在`; //翻转消息 diff --git a/src/onebot/action/go-cqhttp/GetGroupMsgHistory.ts b/src/onebot/action/go-cqhttp/GetGroupMsgHistory.ts index d66f9bdc..17dabae2 100644 --- a/src/onebot/action/go-cqhttp/GetGroupMsgHistory.ts +++ b/src/onebot/action/go-cqhttp/GetGroupMsgHistory.ts @@ -1,7 +1,7 @@ import BaseAction from '../BaseAction'; import { OB11Message } from '@/onebot'; import { ActionName } from '../types'; -import { ChatType, Peer, RawMessage } from '@/core/entities'; +import { ChatType, Peer } from '@/core/entities'; import { FromSchema, JSONSchema } from 'json-schema-to-ts'; import { MessageUnique } from '@/common/message-unique'; @@ -35,7 +35,7 @@ export default class GoCQHTTPGetGroupMsgHistory extends BaseAction { if (payload.image) { //公告图逻辑 const { - errMsg, path, isLocal, success, @@ -49,8 +48,8 @@ export class SendGroupNotice extends BaseAction { } UploadImage = ImageUploadResult.picInfo; } - let noticePinned = +(payload.pinned ?? 0); - let noticeConfirmRequired = +(payload.confirm_required ?? 0); + const noticePinned = +(payload.pinned ?? 0); + const noticeConfirmRequired = +(payload.confirm_required ?? 0); const publishGroupBulletinResult = await NTQQGroupApi.publishGroupBulletin(payload.group_id.toString(), payload.content, UploadImage, noticePinned, noticeConfirmRequired); if (publishGroupBulletinResult.result != 0) { diff --git a/src/shell/napcat.ts b/src/shell/napcat.ts index 0a24c2dd..ed5f3977 100644 --- a/src/shell/napcat.ts +++ b/src/shell/napcat.ts @@ -191,7 +191,7 @@ export async function NCoreInitShell() { logger.log(`可用于快速登录的 QQ:\n${historyLoginList .map((u, index) => `${index + 1}. ${u.uin} ${u.nickName}`) .join('\n') - }`); + }`); } loginService.getQRCodePicture(); }