koishi-plugin-ccb-plus 0.2.5 → 0.2.6

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/lib/index.js +7 -4
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -286,10 +286,13 @@ function apply(ctx, config) {
286
286
  const optionVal = isOff ? options.off : options.on;
287
287
  let targetUserStr = null;
288
288
  if (typeof optionVal === "string" && optionVal.trim()) {
289
- targetUserStr = optionVal;
290
- }
291
- if (!targetUserStr && target) {
292
- targetUserStr = target;
289
+ const val = optionVal.trim();
290
+ const atIdMatch = val.match(/<at\s[^>]*id="([^"]+)"/);
291
+ if (atIdMatch) {
292
+ targetUserStr = atIdMatch[1];
293
+ } else {
294
+ targetUserStr = val;
295
+ }
293
296
  }
294
297
  if (!targetUserStr) {
295
298
  const atEl = session.elements?.find((el) => el.type === "at");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-ccb-plus",
3
3
  "description": "Koishi插件,与群友发生ccb行为。(移植自astrbot_plugin_ccb_plus)",
4
- "version": "0.2.5",
4
+ "version": "0.2.6",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [