mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
merge v3.4.0
This commit is contained in:
parent
ed48a76c33
commit
0e4de038ca
@ -1,18 +1,21 @@
|
||||
// 运行在 Electron 主进程 下的插件入口
|
||||
|
||||
import { BrowserWindow, ipcMain } from 'electron';
|
||||
import {BrowserWindow, ipcMain} from 'electron';
|
||||
import fs from 'fs';
|
||||
|
||||
import { Config } from "../common/types";
|
||||
import { CHANNEL_GET_CONFIG, CHANNEL_LOG, CHANNEL_SET_CONFIG, } from "../common/channels";
|
||||
import { postMsg, setToken, startHTTPServer, startWSServer } from "../onebot11/server";
|
||||
import { CONFIG_DIR, getConfigUtil, log } from "../common/utils";
|
||||
import { addHistoryMsg, getGroupMember, msgHistory, selfInfo, uidMaps } from "../common/data";
|
||||
import { hookNTQQApiReceive, ReceiveCmd, registerReceiveHook } from "../ntqqapi/hook";
|
||||
import { OB11Constructor } from "../onebot11/constructor";
|
||||
import { NTQQApi } from "../ntqqapi/ntcall";
|
||||
import { ChatType, RawMessage } from "../ntqqapi/types";
|
||||
import {Config} from "../common/types";
|
||||
import {CHANNEL_GET_CONFIG, CHANNEL_LOG, CHANNEL_SET_CONFIG,} from "../common/channels";
|
||||
import {initWebsocket, postMsg} from "../onebot11/server";
|
||||
import {CONFIG_DIR, getConfigUtil, log} from "../common/utils";
|
||||
import {addHistoryMsg, getGroupMember, msgHistory, selfInfo} from "../common/data";
|
||||
import {hookNTQQApiCall, hookNTQQApiReceive, ReceiveCmd, registerReceiveHook} from "../ntqqapi/hook";
|
||||
import {OB11Constructor} from "../onebot11/constructor";
|
||||
import {NTQQApi} from "../ntqqapi/ntcall";
|
||||
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;
|
||||
|
||||
@ -32,10 +35,9 @@ function onLoad() {
|
||||
if (arg.ob11.httpPort != oldConfig.ob11.httpPort && arg.ob11.enableHttp) {
|
||||
ob11HTTPServer.restart(arg.ob11.httpPort);
|
||||
}
|
||||
if (!arg.ob11.enableHttp){
|
||||
if (!arg.ob11.enableHttp) {
|
||||
ob11HTTPServer.stop()
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
ob11HTTPServer.start(arg.ob11.httpPort);
|
||||
}
|
||||
if (arg.ob11.wsPort != oldConfig.ob11.wsPort) {
|
||||
@ -128,7 +130,7 @@ function onLoad() {
|
||||
try {
|
||||
ob11HTTPServer.start(config.ob11.httpPort)
|
||||
initWebsocket(config.ob11.wsPort);
|
||||
}catch (e) {
|
||||
} catch (e) {
|
||||
console.log("start failed", e)
|
||||
}
|
||||
log("LLOneBot start")
|
||||
|
@ -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 {log, sleep} from "../common/utils";
|
||||
import {NTQQApi, NTQQApiClass, sendMessagePool} from "./ntcall";
|
||||
|
@ -14,10 +14,8 @@ import GetVersionInfo from "./GetVersionInfo";
|
||||
import CanSendRecord from "./CanSendRecord";
|
||||
import CanSendImage from "./CanSendImage";
|
||||
import GetStatus from "./GetStatus";
|
||||
import TestForwardMsg from "./TestForwdMsg";
|
||||
|
||||
export const actionHandlers = [
|
||||
new TestForwardMsg(),
|
||||
new GetMsg(),
|
||||
new GetLoginInfo(),
|
||||
new GetFriendList(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user