koishi-plugin-toram 4.2.0-test.4 → 4.2.0-test.5

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.
package/lib/index.js CHANGED
@@ -695,7 +695,7 @@ var _BotTodoMgr = class _BotTodoMgr {
695
695
  // 新增一条 todo,返回 id
696
696
  addTodo(ts, type, payload) {
697
697
  const id = `${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;
698
- const todo = { id, ts, type, payload };
698
+ const todo = { todoId: id, ts, type, payload };
699
699
  const list = this._todos.get(ts) || [];
700
700
  list.push(todo);
701
701
  this._todos.set(ts, list);
@@ -716,7 +716,7 @@ var _BotTodoMgr = class _BotTodoMgr {
716
716
  removeTodo(ts, id) {
717
717
  const list = this._todos.get(ts);
718
718
  if (!list) return;
719
- const next = list.filter((x) => x.id !== id);
719
+ const next = list.filter((x) => x.todoId !== id);
720
720
  if (next.length > 0) this._todos.set(ts, next);
721
721
  else this._todos.delete(ts);
722
722
  this.saveTodos();
@@ -869,7 +869,7 @@ async function apply(ctx, config) {
869
869
  });
870
870
  ctx.model.extend("toram_todo", {
871
871
  // 各字段的类型声明
872
- id: "string",
872
+ todoId: "string",
873
873
  ts: "double",
874
874
  type: "string",
875
875
  payload: "json"
@@ -1,6 +1,6 @@
1
1
  import { Context } from "koishi";
2
2
  export interface BotTodoItem {
3
- id: string;
3
+ todoId: string;
4
4
  ts: number;
5
5
  type: string;
6
6
  payload?: any;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-toram",
3
3
  "description": "托拉姆物语小工具",
4
- "version": "4.2.0-test.4",
4
+ "version": "4.2.0-test.5",
5
5
  "contributors": [
6
6
  "青灯 <1874053520@qq.com>"
7
7
  ],