koishi-plugin-xxck-1 0.2.7 → 0.2.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.
- package/lib/index.js +7 -11
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -879,7 +879,7 @@ async function _do_draw(ctx, session, draw_times) {
|
|
|
879
879
|
const starText = get_star_symbol(card.star);
|
|
880
880
|
await session.send(build_msg(
|
|
881
881
|
session,
|
|
882
|
-
session.text("draw.broadcast.getCard", { name: showName, star: starText, id: card.id, cardName: card.
|
|
882
|
+
session.text("draw.broadcast.getCard", { name: showName, star: starText, id: card.id, cardName: card.name })
|
|
883
883
|
));
|
|
884
884
|
await new Promise((r) => setTimeout(r, 1e3));
|
|
885
885
|
}
|
|
@@ -1649,7 +1649,7 @@ async function _do_event_draw(ctx, session, data) {
|
|
|
1649
1649
|
await session.send(build_msg(session, session.text("draw.broadcast.title")));
|
|
1650
1650
|
await new Promise((r) => setTimeout(r, 3e3));
|
|
1651
1651
|
const starText = get_star_symbol(card.card_star);
|
|
1652
|
-
|
|
1652
|
+
session.text("draw.broadcast.getCard", { name: showName, star: starText, id: card.card_id, cardName: card.card_name });
|
|
1653
1653
|
await new Promise((r) => setTimeout(r, 1e3));
|
|
1654
1654
|
}
|
|
1655
1655
|
let msg = session.text("tip.draw.complete", { name: showName }) + "\n";
|
|
@@ -2088,17 +2088,13 @@ async function apply(ctx, config) {
|
|
|
2088
2088
|
if (!session) return;
|
|
2089
2089
|
const content = session.content || "";
|
|
2090
2090
|
let targetQQ = null;
|
|
2091
|
-
const
|
|
2092
|
-
if (
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
const atMatch = content.match(/@(\d+)/);
|
|
2096
|
-
if (atMatch) {
|
|
2097
|
-
targetQQ = atMatch[1];
|
|
2098
|
-
}
|
|
2091
|
+
const atArr = content.match(/\[CQ:at,qq=(\d+)\]/g);
|
|
2092
|
+
if (atArr && atArr.length) {
|
|
2093
|
+
const q = atArr[0].match(/qq=(\d+)/)?.[1];
|
|
2094
|
+
if (q) targetQQ = q;
|
|
2099
2095
|
}
|
|
2100
2096
|
if (!targetQQ) {
|
|
2101
|
-
return await session.send(build_msg(session, "
|
|
2097
|
+
return await session.send(build_msg(session, "请@你要挑战的人"));
|
|
2102
2098
|
}
|
|
2103
2099
|
await doBattleChallenge(ctx, session, targetQQ);
|
|
2104
2100
|
});
|