koishi-plugin-xxck-1 0.2.7 → 0.2.8
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 +3 -10
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -2087,16 +2087,9 @@ async function apply(ctx, config) {
|
|
|
2087
2087
|
const session = argv.session;
|
|
2088
2088
|
if (!session) return;
|
|
2089
2089
|
const content = session.content || "";
|
|
2090
|
-
|
|
2091
|
-
const cqMatch = content.match(/\[CQ:at,qq=(\d+)\]/
|
|
2092
|
-
|
|
2093
|
-
targetQQ = cqMatch[1];
|
|
2094
|
-
} else {
|
|
2095
|
-
const atMatch = content.match(/@(\d+)/);
|
|
2096
|
-
if (atMatch) {
|
|
2097
|
-
targetQQ = atMatch[1];
|
|
2098
|
-
}
|
|
2099
|
-
}
|
|
2090
|
+
const qqMatch = content.match(/@(\d+)/);
|
|
2091
|
+
const cqMatch = content.match(/\[CQ:at,qq=(\d+)\]/);
|
|
2092
|
+
const targetQQ = cqMatch?.[1] || qqMatch?.[1] || null;
|
|
2100
2093
|
if (!targetQQ) {
|
|
2101
2094
|
return await session.send(build_msg(session, "请@你要挑战的人,如:WWC对战@123456"));
|
|
2102
2095
|
}
|