mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0f427375cb | ||
![]() |
4001270b93 | ||
![]() |
e7f5ed3bcc | ||
![]() |
05cdc37d0a | ||
![]() |
27920e0bee |
BIN
external/LiteLoaderWrapper.zip
vendored
BIN
external/LiteLoaderWrapper.zip
vendored
Binary file not shown.
@@ -4,7 +4,7 @@
|
|||||||
"name": "NapCatQQ",
|
"name": "NapCatQQ",
|
||||||
"slug": "NapCat.Framework",
|
"slug": "NapCat.Framework",
|
||||||
"description": "高性能的 OneBot 11 协议实现",
|
"description": "高性能的 OneBot 11 协议实现",
|
||||||
"version": "3.4.8",
|
"version": "3.4.10",
|
||||||
"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": "3.4.8",
|
"version": "3.4.10",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:framework": "vite build --mode framework",
|
"build:framework": "vite build --mode framework",
|
||||||
"build:shell": "vite build --mode shell",
|
"build:shell": "vite build --mode shell",
|
||||||
|
@@ -1 +1 @@
|
|||||||
export const napCatVersion = '3.4.8';
|
export const napCatVersion = '3.4.10';
|
||||||
|
@@ -58,12 +58,9 @@ export abstract class PacketClient {
|
|||||||
private async sendCommand(cmd: string, data: string, trace_id: string, rsp: boolean = false, timeout: number = 20000, sendcb: (json: RecvPacketData) => void = () => {
|
private async sendCommand(cmd: string, data: string, trace_id: string, rsp: boolean = false, timeout: number = 20000, sendcb: (json: RecvPacketData) => void = () => {
|
||||||
}): Promise<RecvPacketData> {
|
}): Promise<RecvPacketData> {
|
||||||
return new Promise<RecvPacketData>((resolve, reject) => {
|
return new Promise<RecvPacketData>((resolve, reject) => {
|
||||||
if (rsp) {
|
const timeoutHandle = setTimeout(() => {
|
||||||
this.registerCallback(trace_id, 'recv', async (json: RecvPacketData) => {
|
reject(new Error(`sendCommand timed out after ${timeout} ms for ${cmd} with trace_id ${trace_id}`));
|
||||||
clearTimeout(timeoutHandle);
|
}, timeout);
|
||||||
resolve(json);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.registerCallback(trace_id, 'send', async (json: RecvPacketData) => {
|
this.registerCallback(trace_id, 'send', async (json: RecvPacketData) => {
|
||||||
sendcb(json);
|
sendcb(json);
|
||||||
if (!rsp) {
|
if (!rsp) {
|
||||||
@@ -71,10 +68,13 @@ export abstract class PacketClient {
|
|||||||
resolve(json);
|
resolve(json);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (rsp) {
|
||||||
|
this.registerCallback(trace_id, 'recv', async (json: RecvPacketData) => {
|
||||||
|
clearTimeout(timeoutHandle);
|
||||||
|
resolve(json);
|
||||||
|
});
|
||||||
|
}
|
||||||
this.sendCommandImpl(cmd, data, trace_id);
|
this.sendCommandImpl(cmd, data, trace_id);
|
||||||
const timeoutHandle = setTimeout(() => {
|
|
||||||
reject(new Error(`sendCommand timed out after ${timeout} ms for ${cmd} with trace_id ${trace_id}`));
|
|
||||||
}, timeout);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -164,7 +164,7 @@ async function onSettingWindowCreated(view) {
|
|||||||
SettingItem(
|
SettingItem(
|
||||||
'<span id="napcat-update-title">Napcat</span>',
|
'<span id="napcat-update-title">Napcat</span>',
|
||||||
void 0,
|
void 0,
|
||||||
SettingButton("V3.4.8", "napcat-update-button", "secondary")
|
SettingButton("V3.4.10", "napcat-update-button", "secondary")
|
||||||
)
|
)
|
||||||
]),
|
]),
|
||||||
SettingList([
|
SettingList([
|
||||||
|
Reference in New Issue
Block a user