diff --git a/src/common/audio.ts b/src/common/audio.ts index 388c0cfd..97bdc921 100644 --- a/src/common/audio.ts +++ b/src/common/audio.ts @@ -45,9 +45,9 @@ async function handleWavFile( ): Promise<{input: Buffer, sampleRate: number}> { const { fmt } = getWavFileInfo(file); if (!ALLOW_SAMPLE_RATE.includes(fmt.sampleRate)) { - return {input: await convert(filePath, pcmPath, logger), sampleRate: 24000}; + return { input: await convert(filePath, pcmPath, logger), sampleRate: 24000 }; } - return {input: file, sampleRate: fmt.sampleRate}; + return { input: file, sampleRate: fmt.sampleRate }; } export async function encodeSilk(filePath: string, TEMP_DIR: string, logger: LogWrapper) { @@ -59,7 +59,7 @@ export async function encodeSilk(filePath: string, TEMP_DIR: string, logger: Log const pcmPath = `${pttPath}.pcm`; const { input, sampleRate } = isWav(file) ? (await handleWavFile(file, filePath, pcmPath, logger)) - : {input: await convert(filePath, pcmPath, logger), sampleRate: 24000}; + : { input: await convert(filePath, pcmPath, logger), sampleRate: 24000 }; const silk = await encode(input, sampleRate); await fsPromise.writeFile(pttPath, silk.data); logger.log(`语音文件${filePath}转换成功!`, pttPath, '时长:', silk.duration); diff --git a/src/common/event.ts b/src/common/event.ts index 3fa5fe8a..c1affa38 100644 --- a/src/common/event.ts +++ b/src/common/event.ts @@ -187,7 +187,7 @@ export class NTEventWrapper { const id = randomUUID(); let complete = 0; let retData: Parameters | undefined = undefined; - let retEvent: any = {}; + const retEvent: any = {}; function sendDataCallback() { if (complete == 0) { diff --git a/src/common/file.ts b/src/common/file.ts index 6ece861c..4fb308a4 100644 --- a/src/common/file.ts +++ b/src/common/file.ts @@ -144,7 +144,7 @@ async function tryDownload(options: string | HttpDownloadOptions, useReferer: bo } if (useReferer && !headers['Referer']) { headers['Referer'] = url; - }; + } const fetchRes = await fetch(url, { headers }).catch((err) => { if (err.cause) { throw err.cause; diff --git a/src/common/qq-basic-info.ts b/src/common/qq-basic-info.ts index 4415f06b..5dcfc909 100644 --- a/src/common/qq-basic-info.ts +++ b/src/common/qq-basic-info.ts @@ -55,23 +55,23 @@ export class QQBasicInfoWrapper { //此方法不要直接使用 getQUAInternal() { switch (systemPlatform) { - case 'linux': - return `V1_LNX_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`; - case 'darwin': - return `V1_MAC_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`; - default: - return `V1_WIN_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`; + case 'linux': + return `V1_LNX_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`; + case 'darwin': + return `V1_MAC_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`; + default: + return `V1_WIN_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`; } } getAppidInternal() { switch (systemPlatform) { - case 'linux': - return '537246140'; - case 'darwin': - return '537246140'; - default: - return '537246092'; + case 'linux': + return '537246140'; + case 'darwin': + return '537246140'; + default: + return '537246092'; } } diff --git a/src/onebot/action/group/GetGroupMemberList.ts b/src/onebot/action/group/GetGroupMemberList.ts index 7e65148e..df632944 100644 --- a/src/onebot/action/group/GetGroupMemberList.ts +++ b/src/onebot/action/group/GetGroupMemberList.ts @@ -23,7 +23,7 @@ class GetGroupMemberList extends BaseAction { async _handle(payload: Payload) { const groupMembers = await this.core.apis.GroupApi.getGroupMembersV2(payload.group_id.toString()); const groupMembersArr = Array.from(groupMembers.values()); - let uids = groupMembersArr.map(item => item.uid); + const uids = groupMembersArr.map(item => item.uid); //let CoreAndBase = await this.core.apis.GroupApi.getCoreAndBaseInfo(uids) let _groupMembers = groupMembersArr.map(item => { return OB11Entities.groupMember(payload.group_id.toString(), item); diff --git a/src/onebot/api/msg.ts b/src/onebot/api/msg.ts index 9e74a146..c58ff3f6 100644 --- a/src/onebot/api/msg.ts +++ b/src/onebot/api/msg.ts @@ -609,7 +609,7 @@ export class OneBotMsgApi { [OB11MessageDataType.miniapp]: async () => undefined, [OB11MessageDataType.contact]: async ({ data }, context) => { - let arkJson = await this.core.apis.UserApi.getBuddyRecommendContactArkJson(data.id.toString(), ''); + const arkJson = await this.core.apis.UserApi.getBuddyRecommendContactArkJson(data.id.toString(), ''); return this.ob11ToRawConverters.json({ data: { data: arkJson.arkMsg }, type: OB11MessageDataType.json diff --git a/src/onebot/network/passive-websocket.ts b/src/onebot/network/passive-websocket.ts index 35b9045e..8c2f2230 100644 --- a/src/onebot/network/passive-websocket.ts +++ b/src/onebot/network/passive-websocket.ts @@ -48,7 +48,7 @@ export class OB11PassiveWebSocketAdapter implements IOB11NetworkAdapter { //鉴权 this.authorize(token, wsClient, wsReq); const paramUrl = wsReq.url?.indexOf('?') !== -1 ? wsReq.url?.substring(0, wsReq.url?.indexOf('?')) : wsReq.url; - const isApiConnect = paramUrl === '/api' || paramUrl === '/api/'; + const isApiConnect = paramUrl === '/api' || paramUrl === '/api/'; if (!isApiConnect) { this.connectEvent(core, wsClient); } @@ -77,7 +77,7 @@ export class OB11PassiveWebSocketAdapter implements IOB11NetworkAdapter { }); }); await this.wsClientsMutex.runExclusive(async () => { - if(!isApiConnect){ + if (!isApiConnect) { this.wsClientWithEvent.push(wsClient); } this.wsClients.push(wsClient); diff --git a/src/shell/napcat.ts b/src/shell/napcat.ts index 9125937f..469caa6d 100644 --- a/src/shell/napcat.ts +++ b/src/shell/napcat.ts @@ -117,7 +117,7 @@ export async function NCoreInitShell() { nick: '', // 获取不到 online: true, }); - } + }; loginListener.onQRCodeGetPicture = ({ pngBase64QrcodeData, qrcodeUrl }) => { //设置WebuiQrcode @@ -209,7 +209,7 @@ export async function NCoreInitShell() { logger.log(`可用于快速登录的 QQ:\n${historyLoginList .map((u, index) => `${index + 1}. ${u.uin} ${u.nickName}`) .join('\n') - }`); + }`); } loginService.getQRCodePicture(); }