koishi-plugin-starfx-bot 0.3.3 → 0.3.4

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.d.ts CHANGED
@@ -6,6 +6,7 @@ export interface Config {
6
6
  openLock: boolean;
7
7
  openSold: boolean;
8
8
  atNotSay: boolean;
9
+ atNotSayOther: boolean;
9
10
  replyBot: string;
10
11
  iLoveYou: boolean;
11
12
  }
@@ -13,12 +14,14 @@ export declare const Config: Schema<Schemastery.ObjectS<{
13
14
  openLock: Schema<boolean, boolean>;
14
15
  openSold: Schema<boolean, boolean>;
15
16
  atNotSay: Schema<boolean, boolean>;
17
+ atNotSayOther: Schema<boolean, boolean>;
16
18
  iLoveYou: Schema<boolean, boolean>;
17
19
  replyBot: Schema<"关闭" | "无需at" | "必须at", "关闭" | "无需at" | "必须at">;
18
20
  }>, {
19
21
  openLock: boolean;
20
22
  openSold: boolean;
21
23
  atNotSay: boolean;
24
+ atNotSayOther: boolean;
22
25
  iLoveYou: boolean;
23
26
  replyBot: "关闭" | "无需at" | "必须at";
24
27
  } & import("cosmokit").Dict>;
package/lib/index.js CHANGED
@@ -51,7 +51,8 @@ var Config = import_koishi.Schema.intersect([
51
51
  import_koishi.Schema.object({
52
52
  openLock: import_koishi.Schema.boolean().default(true).description("开启明日方舟封印功能"),
53
53
  openSold: import_koishi.Schema.boolean().default(true).description('开启闲鱼"卖掉了"功能'),
54
- atNotSay: import_koishi.Schema.boolean().default(true).description("开启‘艾特我/他又不说话’功能"),
54
+ atNotSay: import_koishi.Schema.boolean().default(true).description("开启‘艾特我又不说话’功能"),
55
+ atNotSayOther: import_koishi.Schema.boolean().default(true).description("开启‘艾特他又不说话’功能"),
55
56
  iLoveYou: import_koishi.Schema.boolean().default(true).description("开启‘我喜欢你’功能"),
56
57
  replyBot: import_koishi.Schema.union(["关闭", "无需at", "必须at"]).default("无需at").description("回复‘我才是不是机器人!’功能")
57
58
  })
@@ -82,12 +83,14 @@ function apply(ctx, cfg) {
82
83
  ctx.middleware(async (session, next) => {
83
84
  const elements = session.elements;
84
85
  console.log(elements);
85
- if (cfg.atNotSay) {
86
+ if (cfg.atNotSay || cfg.atNotSayOther) {
86
87
  if (elements.length === 1 && elements[0].type === "at") {
87
88
  if (elements[0].attrs.id === session.selfId) {
88
- await session.send("艾特我又不说话");
89
+ if (cfg.atNotSay)
90
+ await session.send("艾特我又不说话");
89
91
  } else {
90
- await session.send("艾特他又不说话");
92
+ if (cfg.atNotSayOther)
93
+ await session.send("艾特他又不说话");
91
94
  }
92
95
  }
93
96
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "contributors": [
5
5
  "StarFreedomX <starfreedomx@outlook.com>"
6
6
  ],
7
- "version": "0.3.3",
7
+ "version": "0.3.4",
8
8
  "main": "lib/index.js",
9
9
  "typings": "lib/index.d.ts",
10
10
  "files": [
package/readme.md CHANGED
@@ -4,10 +4,20 @@
4
4
 
5
5
  StarFreedomX机器人的小功能,自用
6
6
 
7
- 已加入的功能列表:
7
+ # 已加入的功能列表:
8
8
 
9
9
  * 明日方舟封印功能
10
10
  * 闲鱼“卖掉了”功能
11
11
  * 艾特我/他又不说话
12
12
  * 我才不是机器人!
13
13
  * 我也喜欢你!
14
+
15
+ # 更新日志
16
+ | 版本 | 更新日志 |
17
+ |---------|----------------------------|
18
+ | `0.0.1` | 加入封印功能 |
19
+ | `0.1.0` | 加入"卖掉了"功能 |
20
+ | `0.2.0` | 加入"艾特我又不说话"回复功能 |
21
+ | `0.3.0` | 加入"我喜欢你"和"我才不是机器人!"回复功能 |
22
+ | `0.3.3` | 修订添加"我才不是机器人"是否需要at |
23
+ | `0.3.4` | 分离"艾特我/他又不说话"的两个选项为单独的开关 |