koishi-plugin-chat-analyse 0.4.1 → 0.4.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.
@@ -34,6 +34,7 @@ declare module 'koishi' {
34
34
  timestamp: Date;
35
35
  };
36
36
  analyse_at: {
37
+ id: number;
37
38
  uid: number;
38
39
  target: string;
39
40
  content: string;
package/lib/index.js CHANGED
@@ -55,7 +55,7 @@ var Collector = class _Collector {
55
55
  static FLUSH_INTERVAL = 60 * 1e3;
56
56
  /** @const {number} BUFFER_THRESHOLD - 内存缓存区触发自动刷新的消息数量阈值。 */
57
57
  static BUFFER_THRESHOLD = 100;
58
- // 分离的缓冲区
58
+ // 统一的缓冲区
59
59
  msgStatBuffer = /* @__PURE__ */ new Map();
60
60
  rankStatBuffer = /* @__PURE__ */ new Map();
61
61
  cmdStatBuffer = /* @__PURE__ */ new Map();
@@ -106,11 +106,12 @@ var Collector = class _Collector {
106
106
  }
107
107
  if (this.config.enableWhoAt) {
108
108
  this.ctx.model.extend("analyse_at", {
109
+ id: "unsigned",
109
110
  uid: "unsigned",
110
111
  target: "string",
111
112
  content: "text",
112
113
  timestamp: "timestamp"
113
- }, { indexes: ["target", "uid"] });
114
+ }, { primary: "id", autoInc: true, indexes: ["target", "uid"] });
114
115
  }
115
116
  }
116
117
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-chat-analyse",
3
3
  "description": "聊天记录分析",
4
- "version": "0.4.1",
4
+ "version": "0.4.2",
5
5
  "contributors": [
6
6
  "Yis_Rime <yis_rime@outlook.com>"
7
7
  ],