mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
Compare commits
34 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
02a8999410 | ||
![]() |
59c7979d69 | ||
![]() |
bb7b28cd8f | ||
![]() |
056497b98a | ||
![]() |
ac2fb032c4 | ||
![]() |
c933bdd5d9 | ||
![]() |
89c71a58fa | ||
![]() |
27ba85b4ff | ||
![]() |
79a75fed8e | ||
![]() |
ee7a76b29f | ||
![]() |
c53bdc3ce0 | ||
![]() |
f36e328751 | ||
![]() |
871b5688c2 | ||
![]() |
b96076b297 | ||
![]() |
d4488e40cf | ||
![]() |
7e61497243 | ||
![]() |
e71ccdd12a | ||
![]() |
202129d491 | ||
![]() |
a1700dd503 | ||
![]() |
2954776539 | ||
![]() |
fb1f122ef7 | ||
![]() |
96c63e4689 | ||
![]() |
c94936d3dc | ||
![]() |
8c22f11087 | ||
![]() |
8a089c84a9 | ||
![]() |
b631e6f8a2 | ||
![]() |
b3b48b032c | ||
![]() |
f3e8230eca | ||
![]() |
cc9adf9d40 | ||
![]() |
15a640d1dc | ||
![]() |
c25b9f86db | ||
![]() |
ecfd033afb | ||
![]() |
f3ed8c7dff | ||
![]() |
6089046721 |
@@ -1,6 +1,6 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -32,6 +32,8 @@ NapCatQQ 是现代化的基于 NTQQ 的 Bot 协议端实现
|
|||||||
|
|
||||||
[Server.Other](https://docs.napcat.cyou/)
|
[Server.Other](https://docs.napcat.cyou/)
|
||||||
|
|
||||||
|
[Qbot.News](https://neko.qbot.news)
|
||||||
|
|
||||||
## 回家旅途
|
## 回家旅途
|
||||||
[QQ Group#1](https://qm.qq.com/q/I6LU87a0Yq)
|
[QQ Group#1](https://qm.qq.com/q/I6LU87a0Yq)
|
||||||
|
|
||||||
|
BIN
external/logo.png
vendored
Normal file
BIN
external/logo.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 204 KiB |
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "qq-chat",
|
"name": "qq-chat",
|
||||||
"version": "9.9.16-29927",
|
"version": "9.9.17-30899",
|
||||||
"verHash": "3e273e30",
|
"verHash": "ececf273",
|
||||||
"linuxVersion": "3.2.13-29927",
|
"linuxVersion": "3.2.15-30899",
|
||||||
"linuxVerHash": "833d113c",
|
"linuxVerHash": "63c751e8",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "QQ",
|
"description": "QQ",
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
"qd": "externals/devtools/cli/index.js"
|
"qd": "externals/devtools/cli/index.js"
|
||||||
},
|
},
|
||||||
"main": "./loadNapCat.js",
|
"main": "./loadNapCat.js",
|
||||||
"buildVersion": "29927",
|
"buildVersion": "30899",
|
||||||
"isPureShell": true,
|
"isPureShell": true,
|
||||||
"isByteCodeShell": true,
|
"isByteCodeShell": true,
|
||||||
"platform": "win32",
|
"platform": "win32",
|
||||||
|
BIN
logo.png
BIN
logo.png
Binary file not shown.
Before Width: | Height: | Size: 335 KiB After Width: | Height: | Size: 684 KiB |
@@ -4,7 +4,7 @@
|
|||||||
"name": "NapCatQQ",
|
"name": "NapCatQQ",
|
||||||
"slug": "NapCat.Framework",
|
"slug": "NapCat.Framework",
|
||||||
"description": "高性能的 OneBot 11 协议实现",
|
"description": "高性能的 OneBot 11 协议实现",
|
||||||
"version": "4.2.35",
|
"version": "4.2.40",
|
||||||
"icon": "./logo.png",
|
"icon": "./logo.png",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
"name": "napcat",
|
"name": "napcat",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "4.2.35",
|
"version": "4.2.40",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:universal": "npm run build:webui && vite build --mode universal || exit 1",
|
"build:universal": "npm run build:webui && vite build --mode universal || exit 1",
|
||||||
"build:framework": "npm run build:webui && vite build --mode framework || exit 1",
|
"build:framework": "npm run build:webui && vite build --mode framework || exit 1",
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
"dev:depend": "npm i && cd napcat.webui && npm i"
|
"dev:depend": "npm i && cd napcat.webui && npm i"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"esbuild": "0.24.0",
|
||||||
"@babel/preset-typescript": "^7.24.7",
|
"@babel/preset-typescript": "^7.24.7",
|
||||||
"@eslint/compat": "^1.2.2",
|
"@eslint/compat": "^1.2.2",
|
||||||
"@eslint/eslintrc": "^3.1.0",
|
"@eslint/eslintrc": "^3.1.0",
|
||||||
|
@@ -1 +1 @@
|
|||||||
export const napCatVersion = '4.2.35';
|
export const napCatVersion = '4.2.40';
|
||||||
|
24
src/core/external/appid.json
vendored
24
src/core/external/appid.json
vendored
@@ -134,5 +134,29 @@
|
|||||||
"3.2.15-30594": {
|
"3.2.15-30594": {
|
||||||
"appid": 537258474,
|
"appid": 537258474,
|
||||||
"qua": "V1_LNX_NQ_3.2.15_30594_GW_B"
|
"qua": "V1_LNX_NQ_3.2.15_30594_GW_B"
|
||||||
|
},
|
||||||
|
"9.9.17-30851": {
|
||||||
|
"appid": 537263796,
|
||||||
|
"qua": "V1_WIN_NQ_9.9.17_30851_GW_B"
|
||||||
|
},
|
||||||
|
"3.2.15-30851": {
|
||||||
|
"appid": 537263831,
|
||||||
|
"qua": "V1_LNX_NQ_3.2.15_30851_GW_B"
|
||||||
|
},
|
||||||
|
"6.9.63-30851": {
|
||||||
|
"appid": 537263820,
|
||||||
|
"qua": "V1_MAC_NQ_6.9.63_30851_GW_B"
|
||||||
|
},
|
||||||
|
"9.9.17-30899": {
|
||||||
|
"appid": 537263796,
|
||||||
|
"qua": "V1_WIN_NQ_9.9.17_30899_GW_B"
|
||||||
|
},
|
||||||
|
"3.2.15-30899": {
|
||||||
|
"appid": 537263831,
|
||||||
|
"qua": "V1_LNX_NQ_3.2.15_30899_GW_B"
|
||||||
|
},
|
||||||
|
"6.9.63-30899": {
|
||||||
|
"appid": 537263820,
|
||||||
|
"qua": "V1_MAC_NQ_6.9.63_30899_GW_B"
|
||||||
}
|
}
|
||||||
}
|
}
|
40
src/core/external/offset.json
vendored
40
src/core/external/offset.json
vendored
@@ -162,5 +162,45 @@
|
|||||||
"3.2.15-30594-arm64": {
|
"3.2.15-30594-arm64": {
|
||||||
"send": "70C40E8",
|
"send": "70C40E8",
|
||||||
"recv": "70C7920"
|
"recv": "70C7920"
|
||||||
|
},
|
||||||
|
"9.9.17-30851-x64": {
|
||||||
|
"send": "395C150",
|
||||||
|
"recv": "3960584"
|
||||||
|
},
|
||||||
|
"3.2.15-30851-x64": {
|
||||||
|
"send": "A4A03E0",
|
||||||
|
"recv": "A4A3CE0"
|
||||||
|
},
|
||||||
|
"3.2.15-30851-arm64": {
|
||||||
|
"send": "713A318",
|
||||||
|
"recv": "713DB50"
|
||||||
|
},
|
||||||
|
"6.9.63.30851-x64": {
|
||||||
|
"send": "46C8040",
|
||||||
|
"recv": "46CA8AC"
|
||||||
|
},
|
||||||
|
"6.9.63-30851-arm64": {
|
||||||
|
"send": "41DCBD8",
|
||||||
|
"recv": "41DF3F0"
|
||||||
|
},
|
||||||
|
"9.9.17-30899-x64": {
|
||||||
|
"send": "395C150",
|
||||||
|
"recv": "3960584"
|
||||||
|
},
|
||||||
|
"3.2.15-30899-x64": {
|
||||||
|
"send": "A4A03E0",
|
||||||
|
"recv": "A4A3CE0"
|
||||||
|
},
|
||||||
|
"3.2.15-30899-arm64": {
|
||||||
|
"send": "713A318",
|
||||||
|
"recv": "713DB50"
|
||||||
|
},
|
||||||
|
"6.9.63.30899-x64": {
|
||||||
|
"send": "46C8040",
|
||||||
|
"recv": "46CA8AC"
|
||||||
|
},
|
||||||
|
"6.9.63-30899-arm64": {
|
||||||
|
"send": "41DCBD8",
|
||||||
|
"recv": "41DF3F0"
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,49 +0,0 @@
|
|||||||
// TODO: further refactor in NapCat.Packet v2
|
|
||||||
import { NapProtoMsg, ProtoField, ScalarType } from "@napneko/nap-proto-core";
|
|
||||||
|
|
||||||
const BodyInner = {
|
|
||||||
msgType: ProtoField(1, ScalarType.UINT32, true),
|
|
||||||
subType: ProtoField(2, ScalarType.UINT32, true)
|
|
||||||
};
|
|
||||||
|
|
||||||
const NoifyData = {
|
|
||||||
skip: ProtoField(1, ScalarType.BYTES, true),
|
|
||||||
innerData: ProtoField(2, ScalarType.BYTES, true)
|
|
||||||
};
|
|
||||||
|
|
||||||
const MsgHead = {
|
|
||||||
bodyInner: ProtoField(2, () => BodyInner, true),
|
|
||||||
noifyData: ProtoField(3, () => NoifyData, true)
|
|
||||||
};
|
|
||||||
|
|
||||||
const Message = {
|
|
||||||
msgHead: ProtoField(1, () => MsgHead)
|
|
||||||
};
|
|
||||||
|
|
||||||
const SubDetail = {
|
|
||||||
msgSeq: ProtoField(1, ScalarType.UINT32),
|
|
||||||
msgTime: ProtoField(2, ScalarType.UINT32),
|
|
||||||
senderUid: ProtoField(6, ScalarType.STRING)
|
|
||||||
};
|
|
||||||
|
|
||||||
const RecallDetails = {
|
|
||||||
operatorUid: ProtoField(1, ScalarType.STRING),
|
|
||||||
subDetail: ProtoField(3, () => SubDetail)
|
|
||||||
};
|
|
||||||
|
|
||||||
const RecallGroup = {
|
|
||||||
type: ProtoField(1, ScalarType.INT32),
|
|
||||||
peerUid: ProtoField(4, ScalarType.UINT32),
|
|
||||||
recallDetails: ProtoField(11, () => RecallDetails),
|
|
||||||
grayTipsSeq: ProtoField(37, ScalarType.UINT32)
|
|
||||||
};
|
|
||||||
|
|
||||||
export function decodeMessage(buffer: Uint8Array) {
|
|
||||||
const msg = new NapProtoMsg(Message);
|
|
||||||
return msg.decode(buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function decodeRecallGroup(buffer: Uint8Array){
|
|
||||||
const msg = new NapProtoMsg(RecallGroup);
|
|
||||||
return msg.decode(buffer);
|
|
||||||
}
|
|
138
src/core/helper/status.ts
Normal file
138
src/core/helper/status.ts
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
import os from "node:os";
|
||||||
|
import EventEmitter from "node:events";
|
||||||
|
|
||||||
|
export interface SystemStatus {
|
||||||
|
cpu: {
|
||||||
|
model: string,
|
||||||
|
speed: string
|
||||||
|
usage: {
|
||||||
|
system: string
|
||||||
|
qq: string
|
||||||
|
},
|
||||||
|
core: number
|
||||||
|
},
|
||||||
|
memory: {
|
||||||
|
total: string
|
||||||
|
usage: {
|
||||||
|
system: string
|
||||||
|
qq: string
|
||||||
|
}
|
||||||
|
},
|
||||||
|
arch: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export class StatusHelper {
|
||||||
|
private psCpuUsage = process.cpuUsage();
|
||||||
|
private psCurrentTime = process.hrtime();
|
||||||
|
private cpuTimes = os.cpus().map(cpu => cpu.times);
|
||||||
|
|
||||||
|
private replaceNaN(value: number) {
|
||||||
|
return isNaN(value) ? 0 : value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private sysCpuInfo() {
|
||||||
|
const currentTimes = os.cpus().map(cpu => cpu.times);
|
||||||
|
const { total, active } = currentTimes.map((times, index) => {
|
||||||
|
const prevTimes = this.cpuTimes[index];
|
||||||
|
const totalCurrent = times.user + times.nice + times.sys + times.idle + times.irq;
|
||||||
|
const totalPrev = prevTimes.user + prevTimes.nice + prevTimes.sys + prevTimes.idle + prevTimes.irq;
|
||||||
|
const activeCurrent = totalCurrent - times.idle;
|
||||||
|
const activePrev = totalPrev - prevTimes.idle;
|
||||||
|
return {
|
||||||
|
total: totalCurrent - totalPrev,
|
||||||
|
active: activeCurrent - activePrev
|
||||||
|
};
|
||||||
|
}).reduce((acc, cur) => ({
|
||||||
|
total: acc.total + cur.total,
|
||||||
|
active: acc.active + cur.active
|
||||||
|
}), { total: 0, active: 0 });
|
||||||
|
this.cpuTimes = currentTimes;
|
||||||
|
return {
|
||||||
|
usage: this.replaceNaN(((active / total) * 100)).toFixed(2),
|
||||||
|
model: os.cpus()[0].model,
|
||||||
|
speed: os.cpus()[0].speed,
|
||||||
|
core: os.cpus().length
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private sysMemoryUsage() {
|
||||||
|
const { total, free } = { total: os.totalmem(), free: os.freemem() };
|
||||||
|
return ((total - free) / 1024 / 1024).toFixed(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
private qqUsage() {
|
||||||
|
const mem = process.memoryUsage();
|
||||||
|
const numCpus = os.cpus().length;
|
||||||
|
const usageDiff = process.cpuUsage(this.psCpuUsage);
|
||||||
|
const endTime = process.hrtime(this.psCurrentTime);
|
||||||
|
this.psCpuUsage = process.cpuUsage();
|
||||||
|
this.psCurrentTime = process.hrtime();
|
||||||
|
const usageMS = (usageDiff.user + usageDiff.system) / 1e3;
|
||||||
|
const totalMS = endTime[0] * 1e3 + endTime[1] / 1e6;
|
||||||
|
const normPercent = (usageMS / totalMS / numCpus) * 100;
|
||||||
|
return {
|
||||||
|
cpu: this.replaceNaN(normPercent).toFixed(2),
|
||||||
|
memory: ((mem.heapTotal + mem.external + mem.arrayBuffers) / 1024 / 1024).toFixed(2)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
systemStatus(): SystemStatus {
|
||||||
|
const qqUsage = this.qqUsage();
|
||||||
|
const sysCpuInfo = this.sysCpuInfo();
|
||||||
|
return {
|
||||||
|
cpu: {
|
||||||
|
core: sysCpuInfo.core,
|
||||||
|
model: sysCpuInfo.model,
|
||||||
|
speed: (sysCpuInfo.speed / 1000).toFixed(2),
|
||||||
|
usage: {
|
||||||
|
system: sysCpuInfo.usage,
|
||||||
|
qq: qqUsage.cpu
|
||||||
|
},
|
||||||
|
},
|
||||||
|
memory: {
|
||||||
|
total: (os.totalmem() / 1024 / 1024).toFixed(2),
|
||||||
|
usage: {
|
||||||
|
system: this.sysMemoryUsage(),
|
||||||
|
qq: qqUsage.memory
|
||||||
|
}
|
||||||
|
},
|
||||||
|
arch: `${os.platform()} ${os.arch()} ${os.release()}`
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class StatusHelperSubscription extends EventEmitter {
|
||||||
|
private statusHelper: StatusHelper;
|
||||||
|
private interval: NodeJS.Timeout | null = null;
|
||||||
|
|
||||||
|
constructor(time: number = 3000) {
|
||||||
|
super();
|
||||||
|
this.statusHelper = new StatusHelper();
|
||||||
|
this.on('newListener', (event: string) => {
|
||||||
|
if (event === 'statusUpdate' && this.listenerCount('statusUpdate') === 0) {
|
||||||
|
this.startInterval(time);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.on('removeListener', (event: string) => {
|
||||||
|
if (event === 'statusUpdate' && this.listenerCount('statusUpdate') === 0) {
|
||||||
|
this.stopInterval();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private startInterval(time: number) {
|
||||||
|
this.interval ??= setInterval(() => {
|
||||||
|
const status = this.statusHelper.systemStatus();
|
||||||
|
this.emit('statusUpdate', status);
|
||||||
|
}, time);
|
||||||
|
}
|
||||||
|
|
||||||
|
private stopInterval() {
|
||||||
|
if (this.interval) {
|
||||||
|
clearInterval(this.interval);
|
||||||
|
this.interval = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const statusHelperSubscription = new StatusHelperSubscription();
|
@@ -72,6 +72,14 @@ export const GroupChange = {
|
|||||||
field7: ProtoField(7, ScalarType.BYTES, true),
|
field7: ProtoField(7, ScalarType.BYTES, true),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const GroupInvite = {
|
||||||
|
groupUin: ProtoField(1, ScalarType.UINT32),
|
||||||
|
field2: ProtoField(2, ScalarType.UINT32),
|
||||||
|
field3: ProtoField(2, ScalarType.UINT32),
|
||||||
|
field4: ProtoField(2, ScalarType.UINT32),
|
||||||
|
invitorUid: ProtoField(5, ScalarType.STRING),
|
||||||
|
};
|
||||||
|
|
||||||
export const PushMsgBody = {
|
export const PushMsgBody = {
|
||||||
responseHead: ProtoField(1, () => ResponseHead),
|
responseHead: ProtoField(1, () => ResponseHead),
|
||||||
contentHead: ProtoField(2, () => ContentHead),
|
contentHead: ProtoField(2, () => ContentHead),
|
||||||
|
@@ -508,7 +508,7 @@ export interface RawMessage {
|
|||||||
*/
|
*/
|
||||||
export interface QueryMsgsParams {
|
export interface QueryMsgsParams {
|
||||||
chatInfo: Peer;
|
chatInfo: Peer;
|
||||||
filterMsgType: [];
|
filterMsgType: Array<{ type: NTMsgType, subType: Array<number> }>;
|
||||||
filterSendersUid: string[];
|
filterSendersUid: string[];
|
||||||
filterMsgFromTime: string;
|
filterMsgFromTime: string;
|
||||||
filterMsgToTime: string;
|
filterMsgToTime: string;
|
||||||
|
14
src/onebot/action/extends/GetClientkey.ts
Normal file
14
src/onebot/action/extends/GetClientkey.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { ActionName } from '@/onebot/action/router';
|
||||||
|
import { OneBotAction } from '../OneBotAction';
|
||||||
|
|
||||||
|
interface GetClientkeyResponse {
|
||||||
|
clientkey?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class GetClientkey extends OneBotAction<void, GetClientkeyResponse> {
|
||||||
|
actionName = ActionName.GetClientkey;
|
||||||
|
|
||||||
|
async _handle() {
|
||||||
|
return { clientkey: (await this.core.apis.UserApi.forceFetchClientKey()).clientKey };
|
||||||
|
}
|
||||||
|
}
|
@@ -19,12 +19,11 @@ export default class SetGroupAddRequest extends OneBotAction<Payload, null> {
|
|||||||
const flag = payload.flag.toString();
|
const flag = payload.flag.toString();
|
||||||
const approve = payload.approve?.toString() !== 'false';
|
const approve = payload.approve?.toString() !== 'false';
|
||||||
const reason = payload.reason ?? ' ';
|
const reason = payload.reason ?? ' ';
|
||||||
|
let invite_notify = this.obContext.apis.MsgApi.notifyGroupInvite.get(flag);
|
||||||
const notify = await this.findNotify(flag);
|
const notify = invite_notify ?? await this.findNotify(flag);
|
||||||
if (!notify) {
|
if (!notify) {
|
||||||
throw new Error('No such request');
|
throw new Error('No such request');
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.core.apis.GroupApi.handleGroupRequest(
|
await this.core.apis.GroupApi.handleGroupRequest(
|
||||||
notify,
|
notify,
|
||||||
approve ? NTGroupRequestOperateTypes.KAGREE : NTGroupRequestOperateTypes.KREFUSE,
|
approve ? NTGroupRequestOperateTypes.KAGREE : NTGroupRequestOperateTypes.KREFUSE,
|
||||||
|
@@ -102,6 +102,7 @@ import { SendGroupAiRecord } from "@/onebot/action/group/SendGroupAiRecord";
|
|||||||
import { GetAiCharacters } from "@/onebot/action/extends/GetAiCharacters";
|
import { GetAiCharacters } from "@/onebot/action/extends/GetAiCharacters";
|
||||||
import { GetGuildList } from './guild/GetGuildList';
|
import { GetGuildList } from './guild/GetGuildList';
|
||||||
import { GetGuildProfile } from './guild/GetGuildProfile';
|
import { GetGuildProfile } from './guild/GetGuildProfile';
|
||||||
|
import { GetClientkey } from './extends/GetClientkey';
|
||||||
|
|
||||||
export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCore) {
|
export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCore) {
|
||||||
|
|
||||||
@@ -123,6 +124,7 @@ export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCo
|
|||||||
new GetGroupRootFiles(obContext, core),
|
new GetGroupRootFiles(obContext, core),
|
||||||
new SetGroupSign(obContext, core),
|
new SetGroupSign(obContext, core),
|
||||||
new SendGroupSign(obContext, core),
|
new SendGroupSign(obContext, core),
|
||||||
|
new GetClientkey(obContext, core),
|
||||||
// onebot11
|
// onebot11
|
||||||
new SendLike(obContext, core),
|
new SendLike(obContext, core),
|
||||||
new GetMsg(obContext, core),
|
new GetMsg(obContext, core),
|
||||||
|
@@ -143,4 +143,6 @@ export const ActionName = {
|
|||||||
GetAiRecord: "get_ai_record",
|
GetAiRecord: "get_ai_record",
|
||||||
GetAiCharacters: "get_ai_characters",
|
GetAiCharacters: "get_ai_characters",
|
||||||
SendGroupAiRecord: "send_group_ai_record",
|
SendGroupAiRecord: "send_group_ai_record",
|
||||||
|
|
||||||
|
GetClientkey: "get_clientkey",
|
||||||
} as const;
|
} as const;
|
||||||
|
@@ -12,16 +12,17 @@ export class OneBotFriendApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//使用前预先判断 busiId 1061
|
//使用前预先判断 busiId 1061
|
||||||
async parsePrivatePokeEvent(grayTipElement: GrayTipElement) {
|
async parsePrivatePokeEvent(grayTipElement: GrayTipElement, uin: number) {
|
||||||
const json = JSON.parse(grayTipElement.jsonGrayTipElement.jsonStr);
|
const json = JSON.parse(grayTipElement.jsonGrayTipElement.jsonStr);
|
||||||
let pokedetail: Array<{ uid: string }> = json.items;
|
const pokedetail: Array<{ uid: string }> = json.items;
|
||||||
//筛选item带有uid的元素
|
//筛选item带有uid的元素
|
||||||
pokedetail = pokedetail.filter(item => item.uid);
|
const poke_uid = pokedetail.filter(item => item.uid);
|
||||||
if (pokedetail.length == 2) {
|
if (poke_uid.length == 2) {
|
||||||
return new OB11FriendPokeEvent(
|
return new OB11FriendPokeEvent(
|
||||||
this.core,
|
this.core,
|
||||||
parseInt((await this.core.apis.UserApi.getUinByUidV2(pokedetail[0].uid))),
|
uin,
|
||||||
parseInt((await this.core.apis.UserApi.getUinByUidV2(pokedetail[1].uid))),
|
parseInt((await this.core.apis.UserApi.getUinByUidV2(poke_uid[0].uid))),
|
||||||
|
parseInt((await this.core.apis.UserApi.getUinByUidV2(poke_uid[1].uid))),
|
||||||
pokedetail,
|
pokedetail,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -17,6 +17,7 @@ import {
|
|||||||
SendTextElement,
|
SendTextElement,
|
||||||
FaceType,
|
FaceType,
|
||||||
GrayTipElement,
|
GrayTipElement,
|
||||||
|
GroupNotify,
|
||||||
} from '@/core';
|
} from '@/core';
|
||||||
import faceConfig from '@/core/external/face_config.json';
|
import faceConfig from '@/core/external/face_config.json';
|
||||||
import { NapCatOneBot11Adapter, OB11Message, OB11MessageData, OB11MessageDataType, OB11MessageFileBase, OB11MessageForward, } from '@/onebot';
|
import { NapCatOneBot11Adapter, OB11Message, OB11MessageData, OB11MessageDataType, OB11MessageFileBase, OB11MessageForward, } from '@/onebot';
|
||||||
@@ -33,7 +34,9 @@ import { OB11GroupIncreaseEvent } from '../event/notice/OB11GroupIncreaseEvent';
|
|||||||
import { OB11GroupDecreaseEvent, GroupDecreaseSubType } from '../event/notice/OB11GroupDecreaseEvent';
|
import { OB11GroupDecreaseEvent, GroupDecreaseSubType } from '../event/notice/OB11GroupDecreaseEvent';
|
||||||
import { GroupAdmin } from '@/core/packet/transformer/proto/message/groupAdmin';
|
import { GroupAdmin } from '@/core/packet/transformer/proto/message/groupAdmin';
|
||||||
import { OB11GroupAdminNoticeEvent } from '../event/notice/OB11GroupAdminNoticeEvent';
|
import { OB11GroupAdminNoticeEvent } from '../event/notice/OB11GroupAdminNoticeEvent';
|
||||||
import { GroupChange, GroupChangeInfo, PushMsgBody } from '@/core/packet/transformer/proto';
|
import { GroupChange, GroupChangeInfo, GroupInvite, PushMsgBody } from '@/core/packet/transformer/proto';
|
||||||
|
import { OB11GroupRequestEvent } from '../event/request/OB11GroupRequest';
|
||||||
|
import { LRUCache } from '@/common/lru-cache';
|
||||||
|
|
||||||
type RawToOb11Converters = {
|
type RawToOb11Converters = {
|
||||||
[Key in keyof MessageElement as Key extends `${string}Element` ? Key : never]: (
|
[Key in keyof MessageElement as Key extends `${string}Element` ? Key : never]: (
|
||||||
@@ -67,7 +70,8 @@ function keyCanBeParsed(key: string, parser: RawToOb11Converters): key is keyof
|
|||||||
export class OneBotMsgApi {
|
export class OneBotMsgApi {
|
||||||
obContext: NapCatOneBot11Adapter;
|
obContext: NapCatOneBot11Adapter;
|
||||||
core: NapCatCore;
|
core: NapCatCore;
|
||||||
|
notifyGroupInvite: LRUCache<string, GroupNotify> = new LRUCache(50);
|
||||||
|
// seq -> notify
|
||||||
rawToOb11Converters: RawToOb11Converters = {
|
rawToOb11Converters: RawToOb11Converters = {
|
||||||
textElement: async element => {
|
textElement: async element => {
|
||||||
if (element.atType === NTMsgAtType.ATTYPEUNKNOWN) {
|
if (element.atType === NTMsgAtType.ATTYPEUNKNOWN) {
|
||||||
@@ -679,7 +683,7 @@ export class OneBotMsgApi {
|
|||||||
async parsePrivateMsgEvent(msg: RawMessage, grayTipElement: GrayTipElement) {
|
async parsePrivateMsgEvent(msg: RawMessage, grayTipElement: GrayTipElement) {
|
||||||
if (grayTipElement.subElementType == NTGrayTipElementSubTypeV2.GRAYTIP_ELEMENT_SUBTYPE_JSON) {
|
if (grayTipElement.subElementType == NTGrayTipElementSubTypeV2.GRAYTIP_ELEMENT_SUBTYPE_JSON) {
|
||||||
if (grayTipElement.jsonGrayTipElement.busiId == 1061) {
|
if (grayTipElement.jsonGrayTipElement.busiId == 1061) {
|
||||||
const PokeEvent = await this.obContext.apis.FriendApi.parsePrivatePokeEvent(grayTipElement);
|
const PokeEvent = await this.obContext.apis.FriendApi.parsePrivatePokeEvent(grayTipElement, Number(await this.core.apis.UserApi.getUinByUidV2(msg.peerUid)));
|
||||||
if (PokeEvent) { return PokeEvent; };
|
if (PokeEvent) { return PokeEvent; };
|
||||||
} else if (grayTipElement.jsonGrayTipElement.busiId == 19324 && msg.peerUid !== '') {
|
} else if (grayTipElement.jsonGrayTipElement.busiId == 19324 && msg.peerUid !== '') {
|
||||||
return new OB11FriendAddNoticeEvent(this.core, Number(await this.core.apis.UserApi.getUinByUidV2(msg.peerUid)));
|
return new OB11FriendAddNoticeEvent(this.core, Number(await this.core.apis.UserApi.getUinByUidV2(msg.peerUid)));
|
||||||
@@ -1033,7 +1037,74 @@ export class OneBotMsgApi {
|
|||||||
+await this.core.apis.UserApi.getUinByUidV2(uid),
|
+await this.core.apis.UserApi.getUinByUidV2(uid),
|
||||||
enabled ? 'set' : 'unset'
|
enabled ? 'set' : 'unset'
|
||||||
);
|
);
|
||||||
} else if (SysMessage.contentHead.type == 528 && SysMessage.contentHead.subType == 39 && SysMessage.body?.msgContent) {
|
} else if (SysMessage.contentHead.type == 87 && SysMessage.body?.msgContent) {
|
||||||
|
let groupInvite = new NapProtoMsg(GroupInvite).decode(SysMessage.body.msgContent);
|
||||||
|
let request_seq = '';
|
||||||
|
try {
|
||||||
|
await this.core.eventWrapper.registerListen('NodeIKernelMsgListener/onRecvMsg', (msgs) => {
|
||||||
|
for (const msg of msgs) {
|
||||||
|
if (msg.senderUid === groupInvite.invitorUid && msg.msgType === 11) {
|
||||||
|
let jumpUrl = JSON.parse(msg.elements.find(e => e.elementType === 10)?.arkElement?.bytesData ?? '').meta?.news?.jumpUrl;
|
||||||
|
let jumpUrlParams = new URLSearchParams(jumpUrl);
|
||||||
|
let groupcode = jumpUrlParams.get('groupcode');
|
||||||
|
let receiveruin = jumpUrlParams.get('receiveruin');
|
||||||
|
let msgseq = jumpUrlParams.get('msgseq');
|
||||||
|
request_seq = msgseq ?? '';
|
||||||
|
if (groupcode === groupInvite.groupUin.toString() && receiveruin === this.core.selfInfo.uin) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}, 1, 1000);
|
||||||
|
} catch (error) {
|
||||||
|
request_seq = '';
|
||||||
|
}
|
||||||
|
// 未拉取到seq
|
||||||
|
if (request_seq === '') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 创建个假的
|
||||||
|
this.notifyGroupInvite.put(request_seq, {
|
||||||
|
seq: request_seq,
|
||||||
|
type: 1,
|
||||||
|
group: {
|
||||||
|
groupCode: groupInvite.groupUin.toString(),
|
||||||
|
groupName: '',
|
||||||
|
},
|
||||||
|
user1: {
|
||||||
|
uid: groupInvite.invitorUid,
|
||||||
|
nickName: '',
|
||||||
|
},
|
||||||
|
user2: {
|
||||||
|
uid: this.core.selfInfo.uid,
|
||||||
|
nickName: '',
|
||||||
|
},
|
||||||
|
actionUser: {
|
||||||
|
uid: groupInvite.invitorUid,
|
||||||
|
nickName: '',
|
||||||
|
},
|
||||||
|
actionTime: Date.now().toString(),
|
||||||
|
postscript: '',
|
||||||
|
repeatSeqs: [],
|
||||||
|
warningTips: '',
|
||||||
|
invitationExt: {
|
||||||
|
srcType: 1,
|
||||||
|
groupCode: groupInvite.groupUin.toString(),
|
||||||
|
waitStatus: 1,
|
||||||
|
},
|
||||||
|
status: 1
|
||||||
|
})
|
||||||
|
return new OB11GroupRequestEvent(
|
||||||
|
this.core,
|
||||||
|
+groupInvite.groupUin,
|
||||||
|
+await this.core.apis.UserApi.getUinByUidV2(groupInvite.invitorUid),
|
||||||
|
'invite',
|
||||||
|
'',
|
||||||
|
request_seq
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if (SysMessage.contentHead.type == 528 && SysMessage.contentHead.subType == 39 && SysMessage.body?.msgContent) {
|
||||||
return await this.obContext.apis.UserApi.parseLikeEvent(SysMessage.body?.msgContent);
|
return await this.obContext.apis.UserApi.parseLikeEvent(SysMessage.body?.msgContent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -91,11 +91,13 @@ export class OneBotQuickActionApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async handleGroupRequest(request: OB11GroupRequestEvent, quickAction: QuickActionGroupRequest) {
|
async handleGroupRequest(request: OB11GroupRequestEvent, quickAction: QuickActionGroupRequest) {
|
||||||
const noify = await this.findNotify(request.flag);
|
|
||||||
|
|
||||||
if (!isNull(quickAction.approve) && noify) {
|
let invite_notify = this.obContext.apis.MsgApi.notifyGroupInvite.get(request.flag);
|
||||||
|
const notify = invite_notify ?? await this.findNotify(request.flag);
|
||||||
|
|
||||||
|
if (!isNull(quickAction.approve) && notify) {
|
||||||
this.core.apis.GroupApi.handleGroupRequest(
|
this.core.apis.GroupApi.handleGroupRequest(
|
||||||
noify,
|
notify,
|
||||||
quickAction.approve ? NTGroupRequestOperateTypes.KAGREE : NTGroupRequestOperateTypes.KREFUSE,
|
quickAction.approve ? NTGroupRequestOperateTypes.KAGREE : NTGroupRequestOperateTypes.KREFUSE,
|
||||||
quickAction.reason,
|
quickAction.reason,
|
||||||
).catch(e => this.core.context.logger.logError(e));
|
).catch(e => this.core.context.logger.logError(e));
|
||||||
|
@@ -10,12 +10,14 @@ class OB11PokeEvent extends OB11BaseNoticeEvent {
|
|||||||
|
|
||||||
export class OB11FriendPokeEvent extends OB11PokeEvent {
|
export class OB11FriendPokeEvent extends OB11PokeEvent {
|
||||||
raw_info: any;
|
raw_info: any;
|
||||||
|
sender_id: number;
|
||||||
|
|
||||||
//raw_message nb等框架标准为string
|
//raw_message nb等框架标准为string
|
||||||
constructor(core: NapCatCore, user_id: number, target_id: number, raw_message: any) {
|
constructor(core: NapCatCore, user_id: number, sender_id: number, target_id: number, raw_message: any) {
|
||||||
super(core);
|
super(core);
|
||||||
this.target_id = target_id;
|
this.target_id = target_id;
|
||||||
this.user_id = user_id;
|
this.user_id = user_id;
|
||||||
|
this.sender_id = sender_id;
|
||||||
this.raw_info = raw_message;
|
this.raw_info = raw_message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -164,6 +164,7 @@ export class NapCatOneBot11Adapter {
|
|||||||
this.initBuddyListener();
|
this.initBuddyListener();
|
||||||
this.initGroupListener();
|
this.initGroupListener();
|
||||||
|
|
||||||
|
WebUiDataRuntime.setQQVersion(this.core.context.basicInfoWrapper.getFullQQVesion());
|
||||||
WebUiDataRuntime.setQQLoginInfo(selfInfo);
|
WebUiDataRuntime.setQQLoginInfo(selfInfo);
|
||||||
WebUiDataRuntime.setQQLoginStatus(true);
|
WebUiDataRuntime.setQQLoginStatus(true);
|
||||||
WebUiDataRuntime.setOnOB11ConfigChanged(async (newConfig) => {
|
WebUiDataRuntime.setOnOB11ConfigChanged(async (newConfig) => {
|
||||||
@@ -310,7 +311,7 @@ export class NapCatOneBot11Adapter {
|
|||||||
guildId: ''
|
guildId: ''
|
||||||
};
|
};
|
||||||
const msg = (await this.core.apis.MsgApi.queryMsgsWithFilterExWithSeq(peer, msgSeq)).msgList.find(e => e.msgType == NTMsgType.KMSGTYPEGRAYTIPS);
|
const msg = (await this.core.apis.MsgApi.queryMsgsWithFilterExWithSeq(peer, msgSeq)).msgList.find(e => e.msgType == NTMsgType.KMSGTYPEGRAYTIPS);
|
||||||
const element = msg?.elements[0];
|
const element = msg?.elements.find(e => !!e.grayTipElement?.revokeElement);
|
||||||
if (msg && element) {
|
if (msg && element) {
|
||||||
const recallEvent = await this.emitRecallMsg(msg, element);
|
const recallEvent = await this.emitRecallMsg(msg, element);
|
||||||
try {
|
try {
|
||||||
@@ -467,6 +468,10 @@ export class NapCatOneBot11Adapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async handleMsg(message: RawMessage, network: Array<AdapterConfigWrap>) {
|
private async handleMsg(message: RawMessage, network: Array<AdapterConfigWrap>) {
|
||||||
|
// 过滤无效消息
|
||||||
|
if (message.msgType === NTMsgType.KMSGTYPENULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const ob11Msg = await this.apis.MsgApi.parseMessageV2(message, this.configLoader.configData.parseMultMsg);
|
const ob11Msg = await this.apis.MsgApi.parseMessageV2(message, this.configLoader.configData.parseMultMsg);
|
||||||
if (ob11Msg) {
|
if (ob11Msg) {
|
||||||
|
@@ -17,7 +17,6 @@ export class OB11PassiveWebSocketAdapter extends IOB11NetworkAdapter<WebsocketSe
|
|||||||
wsServer: WebSocketServer;
|
wsServer: WebSocketServer;
|
||||||
wsClients: WebSocket[] = [];
|
wsClients: WebSocket[] = [];
|
||||||
wsClientsMutex = new Mutex();
|
wsClientsMutex = new Mutex();
|
||||||
heartbeatInterval: number = 0;
|
|
||||||
private heartbeatIntervalId: NodeJS.Timeout | null = null;
|
private heartbeatIntervalId: NodeJS.Timeout | null = null;
|
||||||
wsClientWithEvent: WebSocket[] = [];
|
wsClientWithEvent: WebSocket[] = [];
|
||||||
|
|
||||||
@@ -100,7 +99,7 @@ export class OB11PassiveWebSocketAdapter extends IOB11NetworkAdapter<WebsocketSe
|
|||||||
this.logger.log('[OneBot] [WebSocket Server] Server Started', typeof (addressInfo) === 'string' ? addressInfo : addressInfo?.address + ':' + addressInfo?.port);
|
this.logger.log('[OneBot] [WebSocket Server] Server Started', typeof (addressInfo) === 'string' ? addressInfo : addressInfo?.address + ':' + addressInfo?.port);
|
||||||
|
|
||||||
this.isEnable = true;
|
this.isEnable = true;
|
||||||
if (this.heartbeatInterval > 0) {
|
if (this.config.heartInterval > 0) {
|
||||||
this.registerHeartBeat();
|
this.registerHeartBeat();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,11 +133,11 @@ export class OB11PassiveWebSocketAdapter extends IOB11NetworkAdapter<WebsocketSe
|
|||||||
this.wsClientsMutex.runExclusive(async () => {
|
this.wsClientsMutex.runExclusive(async () => {
|
||||||
this.wsClientWithEvent.forEach((wsClient) => {
|
this.wsClientWithEvent.forEach((wsClient) => {
|
||||||
if (wsClient.readyState === WebSocket.OPEN) {
|
if (wsClient.readyState === WebSocket.OPEN) {
|
||||||
wsClient.send(JSON.stringify(new OB11HeartbeatEvent(this.core, this.heartbeatInterval, this.core.selfInfo.online ?? true, true)));
|
wsClient.send(JSON.stringify(new OB11HeartbeatEvent(this.core, this.config.heartInterval, this.core.selfInfo.online ?? true, true)));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, this.heartbeatInterval);
|
}, this.config.heartInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
private authorize(token: string | undefined, wsClient: WebSocket, wsReq: IncomingMessage) {
|
private authorize(token: string | undefined, wsClient: WebSocket, wsReq: IncomingMessage) {
|
||||||
@@ -185,7 +184,7 @@ export class OB11PassiveWebSocketAdapter extends IOB11NetworkAdapter<WebsocketSe
|
|||||||
const wasEnabled = this.isEnable;
|
const wasEnabled = this.isEnable;
|
||||||
const oldPort = this.config.port;
|
const oldPort = this.config.port;
|
||||||
const oldHost = this.config.host;
|
const oldHost = this.config.host;
|
||||||
const oldHeartbeatInterval = this.heartbeatInterval;
|
const oldHeartbeatInterval = this.config.heartInterval;
|
||||||
this.config = newConfig;
|
this.config = newConfig;
|
||||||
|
|
||||||
if (newConfig.enable && !wasEnabled) {
|
if (newConfig.enable && !wasEnabled) {
|
||||||
@@ -214,7 +213,6 @@ export class OB11PassiveWebSocketAdapter extends IOB11NetworkAdapter<WebsocketSe
|
|||||||
clearInterval(this.heartbeatIntervalId);
|
clearInterval(this.heartbeatIntervalId);
|
||||||
this.heartbeatIntervalId = null;
|
this.heartbeatIntervalId = null;
|
||||||
}
|
}
|
||||||
this.heartbeatInterval = newConfig.heartInterval;
|
|
||||||
if (newConfig.heartInterval > 0 && this.isEnable) {
|
if (newConfig.heartInterval > 0 && this.isEnable) {
|
||||||
this.registerHeartBeat();
|
this.registerHeartBeat();
|
||||||
}
|
}
|
||||||
|
@@ -7,3 +7,9 @@ export const PackageInfoHandler: RequestHandler = (_, res) => {
|
|||||||
const data = WebUiDataRuntime.getPackageJson();
|
const data = WebUiDataRuntime.getPackageJson();
|
||||||
sendSuccess(res, data);
|
sendSuccess(res, data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export const QQVersionHandler: RequestHandler = (_, res) => {
|
||||||
|
const data = WebUiDataRuntime.getQQVersion();
|
||||||
|
sendSuccess(res, data);
|
||||||
|
};
|
||||||
|
19
src/webui/src/api/Status.ts
Normal file
19
src/webui/src/api/Status.ts
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import { RequestHandler } from 'express';
|
||||||
|
import { SystemStatus, statusHelperSubscription } from "@/core/helper/status";
|
||||||
|
|
||||||
|
export const StatusRealTimeHandler: RequestHandler = async (req, res) => {
|
||||||
|
res.setHeader('Content-Type', 'text/event-stream');
|
||||||
|
res.setHeader('Connection', 'keep-alive');
|
||||||
|
const sendStatus = (status: SystemStatus) => {
|
||||||
|
try{
|
||||||
|
res.write(`data: ${JSON.stringify(status)}\n\n`);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(`An error occurred when writing sendStatus data to client: ${e}`);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
statusHelperSubscription.on('statusUpdate', sendStatus);
|
||||||
|
req.on('close', () => {
|
||||||
|
statusHelperSubscription.off('statusUpdate', sendStatus);
|
||||||
|
res.end();
|
||||||
|
});
|
||||||
|
};
|
@@ -11,6 +11,7 @@ const LoginRuntime: LoginRuntimeType = {
|
|||||||
uin: '',
|
uin: '',
|
||||||
nick: '',
|
nick: '',
|
||||||
},
|
},
|
||||||
|
QQVersion: 'unknown',
|
||||||
NapCatHelper: {
|
NapCatHelper: {
|
||||||
onOB11ConfigChanged: async () => {
|
onOB11ConfigChanged: async () => {
|
||||||
return;
|
return;
|
||||||
@@ -100,4 +101,12 @@ export const WebUiDataRuntime = {
|
|||||||
getPackageJson() {
|
getPackageJson() {
|
||||||
return LoginRuntime.packageJson;
|
return LoginRuntime.packageJson;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setQQVersion(version: string) {
|
||||||
|
LoginRuntime.QQVersion = version;
|
||||||
|
},
|
||||||
|
|
||||||
|
getQQVersion() {
|
||||||
|
return LoginRuntime.QQVersion;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
import { Router } from 'express';
|
import { Router } from 'express';
|
||||||
import { PackageInfoHandler } from '../api/BaseInfo';
|
import { PackageInfoHandler, QQVersionHandler } from '../api/BaseInfo';
|
||||||
|
import { StatusRealTimeHandler } from "@webapi/api/Status";
|
||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
// router: 获取nc的package.json信息
|
// router: 获取nc的package.json信息
|
||||||
|
router.get('/QQVersion', QQVersionHandler);
|
||||||
router.get('/PackageInfo', PackageInfoHandler);
|
router.get('/PackageInfo', PackageInfoHandler);
|
||||||
|
router.get('/GetSysStatusRealTime', StatusRealTimeHandler);
|
||||||
|
|
||||||
export { router as BaseRouter };
|
export { router as BaseRouter };
|
||||||
|
2
src/webui/src/types/data.d.ts
vendored
2
src/webui/src/types/data.d.ts
vendored
@@ -1,4 +1,5 @@
|
|||||||
import type { LoginListItem, SelfInfo } from '@/core';
|
import type { LoginListItem, SelfInfo } from '@/core';
|
||||||
|
import type { OneBotConfig } from "@/onebot/config/config";
|
||||||
|
|
||||||
interface LoginRuntimeType {
|
interface LoginRuntimeType {
|
||||||
LoginCurrentTime: number;
|
LoginCurrentTime: number;
|
||||||
@@ -7,6 +8,7 @@ interface LoginRuntimeType {
|
|||||||
QQQRCodeURL: string;
|
QQQRCodeURL: string;
|
||||||
QQLoginUin: string;
|
QQLoginUin: string;
|
||||||
QQLoginInfo: SelfInfo;
|
QQLoginInfo: SelfInfo;
|
||||||
|
QQVersion: string;
|
||||||
NapCatHelper: {
|
NapCatHelper: {
|
||||||
onQuickLoginRequested: (uin: string) => Promise<{ result: boolean; message: string }>;
|
onQuickLoginRequested: (uin: string) => Promise<{ result: boolean; message: string }>;
|
||||||
onOB11ConfigChanged: (ob11: OneBotConfig) => Promise<void>;
|
onOB11ConfigChanged: (ob11: OneBotConfig) => Promise<void>;
|
||||||
|
Reference in New Issue
Block a user