style: lint

This commit is contained in:
手瓜一十雪
2024-09-12 09:28:41 +08:00
parent 1cbf75ca36
commit c6241a94e3
7 changed files with 26 additions and 26 deletions

View File

@@ -147,7 +147,7 @@ export class NTQQFileApi {
} catch (e) { } catch (e) {
logger.logError('获取视频信息失败,将使用默认值', e); logger.logError('获取视频信息失败,将使用默认值', e);
} }
let newFilePath = filePath + '.mp4'; const newFilePath = filePath + '.mp4';
fs.renameSync(filePath, newFilePath); fs.renameSync(filePath, newFilePath);
filePath = newFilePath; filePath = newFilePath;
const { fileName: _fileName, path, fileSize, md5 } = await this.core.apis.FileApi.uploadFile(filePath, ElementType.VIDEO); const { fileName: _fileName, path, fileSize, md5 } = await this.core.apis.FileApi.uploadFile(filePath, ElementType.VIDEO);

View File

@@ -40,7 +40,7 @@ export class RkeyManager {
async refreshRkey(): Promise<any> { async refreshRkey(): Promise<any> {
//刷新rkey //刷新rkey
for (let url of this.serverUrl) { for (const url of this.serverUrl) {
try { try {
this.rkeyData = await RequestUtil.HttpGetJson<ServerRkeyData>(url, 'GET'); this.rkeyData = await RequestUtil.HttpGetJson<ServerRkeyData>(url, 'GET');
} catch (e) { } catch (e) {

View File

@@ -37,10 +37,10 @@ export default class GoCQHTTPUploadGroupFile extends BaseAction<Payload, null> {
if (!downloadResult.success) { if (!downloadResult.success) {
throw new Error(downloadResult.errMsg); throw new Error(downloadResult.errMsg);
} }
let msgContext: MessageContext = { const msgContext: MessageContext = {
peer: peer, peer: peer,
deleteAfterSentFiles: [] deleteAfterSentFiles: []
} };
const sendFileEle = await this.core.apis.FileApi.createValidSendFileElement(msgContext, downloadResult.path, payload.name, payload.folder_id); const sendFileEle = await this.core.apis.FileApi.createValidSendFileElement(msgContext, downloadResult.path, payload.name, payload.folder_id);
await this.obContext.apis.MsgApi.sendMsgWithOb11UniqueId(peer, [sendFileEle], [], true); await this.obContext.apis.MsgApi.sendMsgWithOb11UniqueId(peer, [sendFileEle], [], true);
return null; return null;

View File

@@ -45,13 +45,13 @@ export default class GoCQHTTPUploadPrivateFile extends BaseAction<Payload, null>
throw new Error(downloadResult.errMsg); throw new Error(downloadResult.errMsg);
} }
let msgContext: MessageContext = { const msgContext: MessageContext = {
peer: await createContext(this.core, { peer: await createContext(this.core, {
user_id: payload.user_id.toString(), user_id: payload.user_id.toString(),
group_id: undefined, group_id: undefined,
}, ContextMode.Private), }, ContextMode.Private),
deleteAfterSentFiles: [] deleteAfterSentFiles: []
} };
const sendFileEle: SendFileElement = await this.core.apis.FileApi.createValidSendFileElement(msgContext, downloadResult.path, payload.name); const sendFileEle: SendFileElement = await this.core.apis.FileApi.createValidSendFileElement(msgContext, downloadResult.path, payload.name);
await this.obContext.apis.MsgApi.sendMsgWithOb11UniqueId(await this.getPeer(payload), [sendFileEle], [], true); await this.obContext.apis.MsgApi.sendMsgWithOb11UniqueId(await this.getPeer(payload), [sendFileEle], [], true);
return null; return null;

View File

@@ -152,7 +152,7 @@ export class OneBotGroupApi {
parseInt(memberUin), parseInt(memberUin),
title, title,
); );
}; }
case "移出": case "移出":
logger.logDebug('收到机器人被踢消息', json); logger.logDebug('收到机器人被踢消息', json);
return; return;

View File

@@ -827,9 +827,9 @@ export class OneBotMsgApi {
const { msgType, subType, subSubType } = sysMsg.msgSpec[0]; const { msgType, subType, subSubType } = sysMsg.msgSpec[0];
if (msgType === 528 && subType === 39 && subSubType === 39) { if (msgType === 528 && subType === 39 && subSubType === 39) {
if (!sysMsg.bodyWrapper) return; if (!sysMsg.bodyWrapper) return;
let event = await this.obContext.apis.UserApi.parseLikeEvent(sysMsg.bodyWrapper.wrappedBody); const event = await this.obContext.apis.UserApi.parseLikeEvent(sysMsg.bodyWrapper.wrappedBody);
return event; return event;
}; }
/* /*
if (msgType === 732 && subType === 16 && subSubType === 16) { if (msgType === 732 && subType === 16 && subSubType === 16) {
const greyTip = GreyTipWrapper.fromBinary(Uint8Array.from(sysMsg.bodyWrapper!.wrappedBody.slice(7))); const greyTip = GreyTipWrapper.fromBinary(Uint8Array.from(sysMsg.bodyWrapper!.wrappedBody.slice(7)));

View File

@@ -47,7 +47,7 @@ export class OB11PassiveWebSocketAdapter implements IOB11NetworkAdapter {
} }
//鉴权 //鉴权
this.authorize(token, wsClient, wsReq); this.authorize(token, wsClient, wsReq);
let paramUrl = wsReq.url?.indexOf('?') !== -1 ? wsReq.url?.substring(0, wsReq.url?.indexOf('?')) : wsReq.url; const paramUrl = wsReq.url?.indexOf('?') !== -1 ? wsReq.url?.substring(0, wsReq.url?.indexOf('?')) : wsReq.url;
const isEventConnect = paramUrl === '/event' || paramUrl === '' || paramUrl === '/'; const isEventConnect = paramUrl === '/event' || paramUrl === '' || paramUrl === '/';
if (isEventConnect) { if (isEventConnect) {
this.connectEvent(core, wsClient); this.connectEvent(core, wsClient);