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

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 = { todoId: id, ts, type, payload };
698
+ const todo = { 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.todoId !== id);
719
+ const next = list.filter((x) => x.id !== id);
720
720
  if (next.length > 0) this._todos.set(ts, next);
721
721
  else this._todos.delete(ts);
722
722
  this.saveTodos();
@@ -859,20 +859,28 @@ var Config = import_koishi.Schema.intersect([
859
859
  ]);
860
860
  async function apply(ctx, config) {
861
861
  const logger = ctx.logger("toram");
862
- ctx.model.extend("toram_user", {
863
- // 各字段的类型声明
864
- qq: "string",
865
- nickname: "string",
866
- otherNames: "list",
867
- monthlyCardRemindTimeIndex: "integer",
868
- lastGetMonthlyCardDate: "string"
869
- });
862
+ ctx.model.extend(
863
+ "toram_user",
864
+ {
865
+ // 各字段的类型声明
866
+ qq: "string",
867
+ nickname: "string",
868
+ otherNames: "list",
869
+ monthlyCardRemindTimeIndex: "integer",
870
+ lastGetMonthlyCardDate: "string"
871
+ },
872
+ {
873
+ primary: "qq"
874
+ }
875
+ );
870
876
  ctx.model.extend("toram_todo", {
871
877
  // 各字段的类型声明
872
- todoId: "string",
878
+ id: "string",
873
879
  ts: "double",
874
880
  type: "string",
875
881
  payload: "json"
882
+ }, {
883
+ primary: "id"
876
884
  });
877
885
  JsonMgr.Inst().setLogger(logger);
878
886
  await JsonMgr.Inst().loadJson();
@@ -31,5 +31,23 @@
31
31
  "@_atUsers_@ \n今天的月卡记得领取哦!",
32
32
  "@_atUsers_@ \n布谷布谷,领月卡的时间到啦~",
33
33
  "@_atUsers_@ \n快去领今天的月卡吧!"
34
+ ],
35
+ "月卡确认领取": [
36
+ "领月卡是好文明!",
37
+ "看来今天也有好好领月卡呢~",
38
+ "你领月卡啦?这是好的~",
39
+ "明天也不要忘记领月卡哦?"
40
+ ],
41
+ "戳一戳": [
42
+ "呜哇哇哇啊?",
43
+ "为什么要戳书!",
44
+ "错误发生!魔导书重启中……骗你的~",
45
+ "【小声】看不见我看不见我……",
46
+ "【魔导书假装睡着了】",
47
+ "【魔导书尝试戳回去,但是因为没有手失败了】",
48
+ "【魔导书快速翻页制造微风试图飞走】",
49
+ "救命!有人要吃书!【逃走】",
50
+ "魔导书对突然乱戳的行为表示强烈谴责!",
51
+ "戳一戳收费:一枚众神币!"
34
52
  ]
35
53
  }
@@ -1,6 +1,6 @@
1
1
  import { Context } from "koishi";
2
2
  export interface BotTodoItem {
3
- todoId: string;
3
+ id: 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.5",
4
+ "version": "4.2.0",
5
5
  "contributors": [
6
6
  "青灯 <1874053520@qq.com>"
7
7
  ],
@@ -1 +0,0 @@
1
- []