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.
- package/lib/index.js +7 -4
- 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
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
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");
|