llonebot-dist 7.12.0 → 7.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,85 @@
1
+ {
2
+ "webui": {
3
+ "enable": true,
4
+ "host": "127.0.0.1",
5
+ "port": 3080
6
+ },
7
+ "milky": {
8
+ "enable": false,
9
+ "reportSelfMessage": false,
10
+ "http": {
11
+ "host": "127.0.0.1",
12
+ "port": 3010,
13
+ "prefix": "",
14
+ "accessToken": ""
15
+ },
16
+ "webhook": {
17
+ "urls": [],
18
+ "accessToken": ""
19
+ }
20
+ },
21
+ "satori": {
22
+ "enable": false,
23
+ "host": "127.0.0.1",
24
+ "port": 5600,
25
+ "token": ""
26
+ },
27
+ "ob11": {
28
+ "enable": true,
29
+ "connect": [
30
+ {
31
+ "type": "ws",
32
+ "enable": false,
33
+ "host": "127.0.0.1",
34
+ "port": 3001,
35
+ "heartInterval": 60000,
36
+ "token": "",
37
+ "reportSelfMessage": false,
38
+ "reportOfflineMessage": false,
39
+ "messageFormat": "array",
40
+ "debug": false
41
+ },
42
+ {
43
+ "type": "ws-reverse",
44
+ "enable": false,
45
+ "url": "",
46
+ "heartInterval": 60000,
47
+ "token": "",
48
+ "reportSelfMessage": false,
49
+ "reportOfflineMessage": false,
50
+ "messageFormat": "array",
51
+ "debug": false
52
+ },
53
+ {
54
+ "type": "http",
55
+ "enable": false,
56
+ "host": "127.0.0.1",
57
+ "port": 3000,
58
+ "token": "",
59
+ "reportSelfMessage": false,
60
+ "reportOfflineMessage": false,
61
+ "messageFormat": "array",
62
+ "debug": false
63
+ },
64
+ {
65
+ "type": "http-post",
66
+ "enable": false,
67
+ "url": "",
68
+ "enableHeart": false,
69
+ "heartInterval": 60000,
70
+ "token": "",
71
+ "reportSelfMessage": false,
72
+ "reportOfflineMessage": false,
73
+ "messageFormat": "array",
74
+ "debug": false
75
+ }
76
+ ]
77
+ },
78
+ "enableLocalFile2Url": false,
79
+ "log": true,
80
+ "autoDeleteFile": false,
81
+ "autoDeleteFileSecond": 60,
82
+ "musicSignUrl": "https://llob.linyuchen.net/sign/music",
83
+ "msgCacheExpire": 120,
84
+ "ffmpeg": ""
85
+ }
package/llbot.js CHANGED
@@ -11292,7 +11292,7 @@ var OB11HeartbeatEvent = class extends OB11BaseMetaEvent {
11292
11292
  };
11293
11293
  //#endregion
11294
11294
  //#region src/version.ts
11295
- var version$2 = "7.12.0";
11295
+ var version$2 = "7.12.2";
11296
11296
  //#endregion
11297
11297
  //#region node_modules/sift/es5m/index.js
11298
11298
  /******************************************************************************
@@ -12123,7 +12123,7 @@ var OB11WebSocket = class {
12123
12123
  } catch (e) {
12124
12124
  this.ctx.logger.error("发送生命周期失败", e);
12125
12125
  }
12126
- const disposeHeartBeat = this.ctx.setInterval(() => {
12126
+ const disposeHeartBeat = this.ctx.interval(() => {
12127
12127
  const event = new OB11HeartbeatEvent(selfInfo.online, true, this.config.heartInterval);
12128
12128
  if (!matchEventFilter(this.config.filter, event)) return;
12129
12129
  this.reply(socket, event);
@@ -12245,7 +12245,7 @@ var OB11WebSocketReverse = class {
12245
12245
  this.wsClient.on("ping", () => {
12246
12246
  this.wsClient?.pong();
12247
12247
  });
12248
- const disposeHeartBeat = this.ctx.setInterval(() => {
12248
+ const disposeHeartBeat = this.ctx.interval(() => {
12249
12249
  if (this.wsClient) {
12250
12250
  const event = new OB11HeartbeatEvent(selfInfo.online, true, this.config.heartInterval);
12251
12251
  if (!matchEventFilter(this.config.filter, event)) return;
@@ -12255,7 +12255,7 @@ var OB11WebSocketReverse = class {
12255
12255
  this.wsClient.on("close", (code) => {
12256
12256
  disposeHeartBeat();
12257
12257
  this.ctx.logger.info(`The websocket connection: ${this.config.url} closed, code ${code}${this.activated ? ", trying reconnecting..." : ""}`);
12258
- if (this.activated) this.ctx.setTimeout(() => this.tryConnect(), 3e3);
12258
+ if (this.activated) this.ctx.timeout(() => this.tryConnect(), 3e3);
12259
12259
  });
12260
12260
  }
12261
12261
  };
@@ -20839,8 +20839,9 @@ var OB11Http = class {
20839
20839
  return new Promise((resolve) => {
20840
20840
  if (this.server) {
20841
20841
  this.ctx.logger.info("OneBot V11 HTTP Server closing...");
20842
- this.server.closeAllConnections();
20843
- this.server.close((err) => {
20842
+ const server = this.server;
20843
+ server.closeAllConnections();
20844
+ server.close((err) => {
20844
20845
  if (err) this.ctx.logger.error(`OneBot V11 HTTP Server closing ${err}`);
20845
20846
  else this.ctx.logger.info("OneBot V11 HTTP Server closed");
20846
20847
  this.server = void 0;
@@ -20925,7 +20926,7 @@ var OB11HttpPost = class {
20925
20926
  }
20926
20927
  start() {
20927
20928
  this.activated = this.config.enable;
20928
- if (this.config.enableHeart && !this.disposeInterval) this.disposeInterval = this.ctx.setInterval(() => {
20929
+ if (this.config.enableHeart && !this.disposeInterval) this.disposeInterval = this.ctx.interval(() => {
20929
20930
  this.emitEvent(new OB11HeartbeatEvent(selfInfo.online, true, this.config.heartInterval));
20930
20931
  }, this.config.heartInterval);
20931
20932
  }
@@ -51829,6 +51830,7 @@ var RkeyManager = class {
51829
51830
  private_rkey: "",
51830
51831
  expired_time: 0
51831
51832
  };
51833
+ pull;
51832
51834
  constructor(ctx, serverUrl) {
51833
51835
  this.ctx = ctx;
51834
51836
  this.serverUrl = serverUrl;
@@ -51845,6 +51847,9 @@ var RkeyManager = class {
51845
51847
  return (/* @__PURE__ */ new Date()).getTime() / 1e3 > this.rkeyData.expired_time;
51846
51848
  }
51847
51849
  async refreshRkey() {
51850
+ if (this.pull) return this.pull;
51851
+ const { promise, resolve } = Promise.withResolvers();
51852
+ this.pull = promise;
51848
51853
  try {
51849
51854
  const { privateRKey, groupRKey, expiredTime } = await this.ctx.pmhq.getRKey();
51850
51855
  this.rkeyData = {
@@ -51852,14 +51857,14 @@ var RkeyManager = class {
51852
51857
  group_rkey: groupRKey,
51853
51858
  expired_time: expiredTime
51854
51859
  };
51860
+ resolve();
51861
+ this.pull = void 0;
51855
51862
  this.ctx.logger.info(`发包获取rkey成功, private:${privateRKey}, group:${groupRKey}`);
51856
51863
  } catch (e) {
51857
51864
  this.ctx.logger.warn(`发包获取rkey失败 ${e},开始获取远程rkey`);
51858
- try {
51859
- this.rkeyData = await this.fetchServerRkey();
51860
- } catch (e) {
51861
- this.ctx.logger.error("获取远程rkey失败", e);
51862
- }
51865
+ this.rkeyData = await this.fetchServerRkey();
51866
+ resolve();
51867
+ this.pull = void 0;
51863
51868
  }
51864
51869
  }
51865
51870
  async fetchServerRkey() {
@@ -69632,7 +69637,7 @@ async function onLoad() {
69632
69637
  if (!existsSync$1(LOG_DIR)) mkdirSync(LOG_DIR);
69633
69638
  if (!existsSync$1(TEMP_DIR)) mkdirSync(TEMP_DIR);
69634
69639
  const ctx = new Context$1();
69635
- ctx.plugin(index_default$3);
69640
+ ctx.plugin(index_default$3, { bufferSize: 0 });
69636
69641
  ctx.plugin(index_default);
69637
69642
  ctx.plugin(Config);
69638
69643
  ctx.plugin(PMHQ);