style&&chore: lint

This commit is contained in:
手瓜一十雪
2024-08-14 00:47:50 +08:00
parent 29b51adf7d
commit 00fdce8876
10 changed files with 118 additions and 118 deletions

View File

@@ -141,7 +141,7 @@ export class NTQQFileApi {
filePath: thumbPath, filePath: thumbPath,
}, },
); );
let msg = await this.core.apis.MsgApi.getMsgsByMsgId({ const msg = await this.core.apis.MsgApi.getMsgsByMsgId({
guildId: '', guildId: '',
chatType: chatType, chatType: chatType,
peerUid: peerUid, peerUid: peerUid,
@@ -150,13 +150,13 @@ export class NTQQFileApi {
return data[1].filePath; return data[1].filePath;
} }
//获取原始消息 //获取原始消息
let FileElements = msg?.msgList[0]?.elements?.find(e => e.elementId === elementId); const FileElements = msg?.msgList[0]?.elements?.find(e => e.elementId === elementId);
if (!FileElements) { if (!FileElements) {
//失败则就乱来 Todo //失败则就乱来 Todo
return data[1].filePath; return data[1].filePath;
} }
//从原始消息获取文件路径 //从原始消息获取文件路径
let filePath = const filePath =
FileElements?.fileElement?.filePath || FileElements?.fileElement?.filePath ||
FileElements?.pttElement?.filePath || FileElements?.pttElement?.filePath ||
FileElements?.videoElement?.filePath || FileElements?.videoElement?.filePath ||

View File

@@ -186,7 +186,7 @@ export class NTQQMsgApi {
} }
async PrepareTempChat(toUserUid: string, GroupCode: string, nickname: string) { async PrepareTempChat(toUserUid: string, GroupCode: string, nickname: string) {
//By Jadx/Ida Mlikiowa //By Jadx/Ida Mlikiowa
let TempGameSession = { const TempGameSession = {
nickname: "", nickname: "",
gameAppId: "", gameAppId: "",
selfTinyId: "", selfTinyId: "",
@@ -210,7 +210,7 @@ export class NTQQMsgApi {
async sendMsg(peer: Peer, msgElements: SendMessageElement[], waitComplete = true, timeout = 10000) { async sendMsg(peer: Peer, msgElements: SendMessageElement[], waitComplete = true, timeout = 10000) {
//唉? !我有个想法 //唉? !我有个想法
if (peer.chatType === ChatType.temp && peer.guildId && peer.guildId !== '') { if (peer.chatType === ChatType.temp && peer.guildId && peer.guildId !== '') {
let member = await this.core.apis.GroupApi.getGroupMember(peer.guildId, peer.peerUid!); const member = await this.core.apis.GroupApi.getGroupMember(peer.guildId, peer.peerUid!);
if (member) { if (member) {
await this.PrepareTempChat(peer.peerUid, peer.guildId, member.nick); await this.PrepareTempChat(peer.peerUid, peer.guildId, member.nick);
} }

View File

@@ -156,8 +156,8 @@ export class NTQQUserApi {
async getCookies(domain: string) { async getCookies(domain: string) {
const ClientKeyData = await this.forceFetchClientKey(); const ClientKeyData = await this.forceFetchClientKey();
const requestUrl = 'https://ssl.ptlogin2.qq.com/jump?ptlang=1033&clientuin=' + this.core.selfInfo.uin + const requestUrl = 'https://ssl.ptlogin2.qq.com/jump?ptlang=1033&clientuin=' + this.core.selfInfo.uin +
'&clientkey=' + ClientKeyData.clientKey + '&u1=https%3A%2F%2F' + domain + '%2F' + this.core.selfInfo.uin + '%2Finfocenter&keyindex=19%27' '&clientkey=' + ClientKeyData.clientKey + '&u1=https%3A%2F%2F' + domain + '%2F' + this.core.selfInfo.uin + '%2Finfocenter&keyindex=19%27';
let cookies: { [key: string]: string; } = await RequestUtil.HttpsGetCookies(requestUrl); const cookies: { [key: string]: string; } = await RequestUtil.HttpsGetCookies(requestUrl);
return cookies; return cookies;
} }

View File

@@ -13,7 +13,7 @@ import { NapCatOneBot11Adapter } from '@/onebot';
//Framework ES入口文件 //Framework ES入口文件
export async function getWebUiUrl() { export async function getWebUiUrl() {
let WebUiConfigData = (await WebUiConfig.GetWebUIConfig()); const WebUiConfigData = (await WebUiConfig.GetWebUIConfig());
return "http://127.0.0.1:" + WebUiConfigData.port + '/webui/?token=' + WebUiConfigData.token; return "http://127.0.0.1:" + WebUiConfigData.port + '/webui/?token=' + WebUiConfigData.token;
} }
export async function NCoreInitFramework( export async function NCoreInitFramework(

View File

@@ -13,7 +13,7 @@ export const onSettingWindowCreated = async (view) => {
// //iframe.scrolling = "no"; // //iframe.scrolling = "no";
// //有滚动条何尝不是一种美 // //有滚动条何尝不是一种美
// view.appendChild(iframe); // view.appendChild(iframe);
let webui = await window.napcat.getWebUiUrl() let webui = await window.napcat.getWebUiUrl();
let panel = ` let panel = `
<setting-section data-title=""> <setting-section data-title="">
<setting-panel> <setting-panel>

View File

@@ -37,7 +37,7 @@ export class OB11PassiveWebSocketAdapter implements IOB11NetworkAdapter {
this.heartbeatInterval = heartbeatInterval; this.heartbeatInterval = heartbeatInterval;
this.wsServer = new WebSocketServer({ port: port, host: ip }); this.wsServer = new WebSocketServer({ port: port, host: ip });
let core = coreContext; const core = coreContext;
this.wsServer.on('connection', async (wsClient, wsReq) => { this.wsServer.on('connection', async (wsClient, wsReq) => {
if (!this.isOpen) { if (!this.isOpen) {
wsClient.close(); wsClient.close();

View File

@@ -19,7 +19,7 @@ export let webUiPathWrapper: NapCatPathWrapper;
export async function InitWebUi(logger: LogWrapper, pathWrapper: NapCatPathWrapper) { export async function InitWebUi(logger: LogWrapper, pathWrapper: NapCatPathWrapper) {
webUiPathWrapper = pathWrapper; webUiPathWrapper = pathWrapper;
WebUiConfig = new WebUiConfigWrapper(); WebUiConfig = new WebUiConfigWrapper();
let log = logger.log.bind(logger); const log = logger.log.bind(logger);
const config = await WebUiConfig.GetWebUIConfig(); const config = await WebUiConfig.GetWebUIConfig();
if (config.port == 0) { if (config.port == 0) {
log('[NapCat] [WebUi] Current WebUi is not run.'); log('[NapCat] [WebUi] Current WebUi is not run.');