koishi-plugin-toram 0.6.6 → 0.6.7

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,57 @@
1
+ {
2
+ "type": "table",
3
+ "database": null,
4
+ "name": "toram_dogs",
5
+ "withoutRowId": true,
6
+ "ddl": "CREATE TABLE toram_dogs (id undefined, name TEXT DEFAULT '', type TEXT DEFAULT '', event TEXT DEFAULT '', PRIMARY KEY (id));",
7
+ "columns": [
8
+ {
9
+ "name": "id",
10
+ "type": "undefined"
11
+ },
12
+ {
13
+ "name": "name",
14
+ "type": "TEXT",
15
+ "constraints": [
16
+ {
17
+ "type": "DEFAULT",
18
+ "definition": "DEFAULT ''"
19
+ }
20
+ ]
21
+ },
22
+ {
23
+ "name": "type",
24
+ "type": "TEXT",
25
+ "constraints": [
26
+ {
27
+ "type": "DEFAULT",
28
+ "definition": "DEFAULT ''"
29
+ }
30
+ ]
31
+ },
32
+ {
33
+ "name": "event",
34
+ "type": "TEXT",
35
+ "constraints": [
36
+ {
37
+ "type": "DEFAULT",
38
+ "definition": "DEFAULT ''"
39
+ }
40
+ ]
41
+ }
42
+ ],
43
+ "constraints": [
44
+ {
45
+ "type": "PRIMARY KEY",
46
+ "definition": "PRIMARY KEY (id)"
47
+ }
48
+ ],
49
+ "rows": [
50
+ [
51
+ 1,
52
+ "真的还是假的",
53
+ "main",
54
+ "无视加载,秒杀海骑士"
55
+ ]
56
+ ]
57
+ }
package/lib/index.js CHANGED
@@ -55,6 +55,14 @@ async function apply(ctx, config) {
55
55
  type: 'string'
56
56
  }, //游戏术语(游戏称呼)
57
57
  { primary: 'id' });
58
+ // 挂狗记录库
59
+ ctx.model.extend('toram_dogs', {
60
+ id: 'number',
61
+ name: 'string',
62
+ type: 'string',
63
+ event: 'string'
64
+ }, //挂狗事件
65
+ { primary: 'id' });
58
66
  // 更新内容数据库
59
67
  ctx.model.extend('toram_update', {
60
68
  id: 'number',
@@ -81,6 +89,8 @@ async function apply(ctx, config) {
81
89
  version: '0.6.4' },
82
90
  { tableName: 'toram_terminology_name', fileName: './data/terminology_name',
83
91
  version: '0.6.4' },
92
+ { tableName: 'toram_dogs', fileName: './data/toram_dogs',
93
+ version: '0.6.7' },
84
94
  { tableName: 'toram_update', fileName: './data/update',
85
95
  version: '0.6.4' }
86
96
  ];
@@ -416,6 +426,11 @@ async function apply(ctx, config) {
416
426
  { id: row[0], name: row[1], type: row[2] }
417
427
  ]);
418
428
  break;
429
+ case 'toram_dogs':
430
+ await ctx.database.upsert('toram_dogs', [
431
+ { id: row[0], name: row[1], type: row[2], event: row[3] }
432
+ ]);
433
+ break;
419
434
  case 'toram_terminology':
420
435
  await ctx.database.upsert('toram_terminology', [
421
436
  { id: row[0], type: row[1], website: row[2] }
@@ -467,6 +482,25 @@ async function apply(ctx, config) {
467
482
  }
468
483
  return next();
469
484
  });
485
+ // 挂狗名单指令
486
+ ctx.command('挂狗名单').action(async ({ session }, ...args) => {
487
+ var dogs = await ctx.database.get('toram_dogs', { type: "main" });
488
+ dogs = dogs.sort(function compareFunction(dog1, dog2) {
489
+ return dog1.localeCompare(dog2);
490
+ });
491
+ var dogsList = dogs.map((dog) => {
492
+ return `${dog?.name}`;
493
+ });
494
+ text = "挂狗名单如下:\n" + dogsList;
495
+ text = text.replace(/,/g, ',');
496
+ return text;
497
+ });
498
+ /*
499
+ // 挂个狗
500
+ ctx.command('挂个狗 <挂狗昵称>').action(async({session}, ...args ) => {
501
+
502
+ })
503
+ */
470
504
  // 料理指令
471
505
  ctx.command('料理 <料理种类> <料理等级>').action(async ({ session }, ...args) => {
472
506
  let DishesName = args[0], DishesLevelChoice = args[1];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-toram",
3
3
  "description": "托拉姆物语小工具",
4
- "version": "0.6.6",
4
+ "version": "0.6.7",
5
5
  "contributors": [
6
6
  "青灯 <1874053520@qq.com>"
7
7
  ],