merge v3.4.0

This commit is contained in:
linyuchen 2024-02-20 16:12:46 +08:00
parent ed48a76c33
commit 0e4de038ca
3 changed files with 17 additions and 23 deletions

View File

@ -1,18 +1,21 @@
// 运行在 Electron 主进程 下的插件入口 // 运行在 Electron 主进程 下的插件入口
import { BrowserWindow, ipcMain } from 'electron'; import {BrowserWindow, ipcMain} from 'electron';
import fs from 'fs';
import { Config } from "../common/types"; import {Config} from "../common/types";
import { CHANNEL_GET_CONFIG, CHANNEL_LOG, CHANNEL_SET_CONFIG, } from "../common/channels"; import {CHANNEL_GET_CONFIG, CHANNEL_LOG, CHANNEL_SET_CONFIG,} from "../common/channels";
import { postMsg, setToken, startHTTPServer, startWSServer } from "../onebot11/server"; import {initWebsocket, postMsg} from "../onebot11/server";
import { CONFIG_DIR, getConfigUtil, log } from "../common/utils"; import {CONFIG_DIR, getConfigUtil, log} from "../common/utils";
import { addHistoryMsg, getGroupMember, msgHistory, selfInfo, uidMaps } from "../common/data"; import {addHistoryMsg, getGroupMember, msgHistory, selfInfo} from "../common/data";
import { hookNTQQApiReceive, ReceiveCmd, registerReceiveHook } from "../ntqqapi/hook"; import {hookNTQQApiCall, hookNTQQApiReceive, ReceiveCmd, registerReceiveHook} from "../ntqqapi/hook";
import { OB11Constructor } from "../onebot11/constructor"; import {OB11Constructor} from "../onebot11/constructor";
import { NTQQApi } from "../ntqqapi/ntcall"; import {NTQQApi} from "../ntqqapi/ntcall";
import { ChatType, RawMessage } from "../ntqqapi/types"; import {ChatType, RawMessage} from "../ntqqapi/types";
import {ob11HTTPServer} from "../onebot11/server/http";
import {OB11FriendRecallNoticeEvent} from "../onebot11/event/notice/OB11FriendRecallNoticeEvent";
import {OB11GroupRecallNoticeEvent} from "../onebot11/event/notice/OB11GroupRecallNoticeEvent";
const fs = require('fs');
let running = false; let running = false;
@ -32,10 +35,9 @@ function onLoad() {
if (arg.ob11.httpPort != oldConfig.ob11.httpPort && arg.ob11.enableHttp) { if (arg.ob11.httpPort != oldConfig.ob11.httpPort && arg.ob11.enableHttp) {
ob11HTTPServer.restart(arg.ob11.httpPort); ob11HTTPServer.restart(arg.ob11.httpPort);
} }
if (!arg.ob11.enableHttp){ if (!arg.ob11.enableHttp) {
ob11HTTPServer.stop() ob11HTTPServer.stop()
} } else {
else{
ob11HTTPServer.start(arg.ob11.httpPort); ob11HTTPServer.start(arg.ob11.httpPort);
} }
if (arg.ob11.wsPort != oldConfig.ob11.wsPort) { if (arg.ob11.wsPort != oldConfig.ob11.wsPort) {
@ -128,7 +130,7 @@ function onLoad() {
try { try {
ob11HTTPServer.start(config.ob11.httpPort) ob11HTTPServer.start(config.ob11.httpPort)
initWebsocket(config.ob11.wsPort); initWebsocket(config.ob11.wsPort);
}catch (e) { } catch (e) {
console.log("start failed", e) console.log("start failed", e)
} }
log("LLOneBot start") log("LLOneBot start")

View File

@ -1,9 +1,3 @@
import { BrowserWindow } from 'electron';
import { log } from "../common/utils";
import { NTQQApi, NTQQApiClass, sendMessagePool } from "./ntcall";
import { Group, RawMessage, User } from "./types";
import { addHistoryMsg, friends, groups, msgHistory } from "../common/data";
import { v4 as uuidv4 } from 'uuid';
import {BrowserWindow} from 'electron'; import {BrowserWindow} from 'electron';
import {log, sleep} from "../common/utils"; import {log, sleep} from "../common/utils";
import {NTQQApi, NTQQApiClass, sendMessagePool} from "./ntcall"; import {NTQQApi, NTQQApiClass, sendMessagePool} from "./ntcall";

View File

@ -14,10 +14,8 @@ import GetVersionInfo from "./GetVersionInfo";
import CanSendRecord from "./CanSendRecord"; import CanSendRecord from "./CanSendRecord";
import CanSendImage from "./CanSendImage"; import CanSendImage from "./CanSendImage";
import GetStatus from "./GetStatus"; import GetStatus from "./GetStatus";
import TestForwardMsg from "./TestForwdMsg";
export const actionHandlers = [ export const actionHandlers = [
new TestForwardMsg(),
new GetMsg(), new GetMsg(),
new GetLoginInfo(), new GetLoginInfo(),
new GetFriendList(), new GetFriendList(),