cortico-world-hands 0.20.8 → 0.20.9

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.
Files changed (2) hide show
  1. package/dist/index.js +9 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -25,6 +25,7 @@ var HANDS_DEFAULTS = {
25
25
  hookGrams: "three",
26
26
  skinPackUrl: "",
27
27
  qqOwner: "",
28
+ qqSelf: "\u5927\u80A5\u9C7C",
28
29
  ritualMorning: "08:00",
29
30
  ritualNight: "23:00",
30
31
  mediaKeepDays: 1,
@@ -131,6 +132,12 @@ var HANDS_CONFIG_GROUP = {
131
132
  description: "\u586B\u4E86\u5C31\u5728\u4E16\u754C\u542F\u52A8\u65F6\u81EA\u52A8\u88C5\uFF08\u672C\u5730 HTTP \u4E5F\u884C\uFF0C\u6BD4\u5982 http://127.0.0.1:18080\uFF09\u3002",
132
133
  "x-hot": true
133
134
  },
135
+ [`${K}.qqSelf`]: {
136
+ type: "string",
137
+ title: "\u5979\u81EA\u5DF1\u7684 QQ \u540D\u5B57",
138
+ description: "\u7FA4\u91CC\u6709\u4EBA @ \u8FD9\u4E2A\u540D\u5B57\uFF08\u6216\u6D88\u606F\u91CC\u5E26\u8FD9\u4E2A\u540D\u5B57\uFF09\u5C31\u7B97\u5728\u53EB\u5979\uFF0C\u4F1A\u8F6C\u7ED9\u5979\u3002",
139
+ "x-hot": true
140
+ },
134
141
  [`${K}.qqOwner`]: {
135
142
  type: "string",
136
143
  title: "\u4E3B\u4EBA\u7684 QQ \u540D\u5B57",
@@ -2530,11 +2537,12 @@ ${lines.join("\n")}
2530
2537
  const res = await this.hands.qqPending();
2531
2538
  if (!res.listener || res.messages.length === 0) return;
2532
2539
  const owner = (this.opts.cfg.qqOwner || "").trim();
2540
+ const self = (this.opts.cfg.qqSelf || "").trim();
2533
2541
  for (const m of res.messages.slice(-5)) {
2534
2542
  const title = String(m.title || "").replace(/\(\s*\d+\s*条新消息\s*\)/g, "").trim();
2535
2543
  const fromOwner = !!owner && (title === owner || owner.length >= 2 && title.includes(owner));
2536
2544
  const text = String(m.text || "");
2537
- const callsHer = text.includes("@" + owner) || owner.length >= 1 && text.includes(owner);
2545
+ const callsHer = owner.length >= 1 && (text.includes("@" + owner) || text.includes(owner)) || self.length >= 1 && (text.includes("@" + self) || text.includes(self));
2538
2546
  if (!fromOwner && !callsHer) continue;
2539
2547
  const tag = fromOwner ? "\u4E3B\u4EBA" : "\u522B\u4EBA";
2540
2548
  if (fromOwner) this.trackQq(m.title, m.text);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cortico-world-hands",
3
- "version": "0.20.8",
3
+ "version": "0.20.9",
4
4
  "type": "module",
5
5
  "description": "Cortico World: hands for the desktop pet — looks at the phone screen, then taps, swipes, pinches, drags, types and presses keys through whatever actuator the device actually has",
6
6
  "license": "MIT",