koishi-plugin-xxck-1 0.2.8 → 0.2.10
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 +15 -8
- 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";
|
|
@@ -2087,15 +2087,22 @@ async function apply(ctx, config) {
|
|
|
2087
2087
|
const session = argv.session;
|
|
2088
2088
|
if (!session) return;
|
|
2089
2089
|
const content = session.content || "";
|
|
2090
|
-
|
|
2090
|
+
let targetQQ = null;
|
|
2091
2091
|
const cqMatch = content.match(/\[CQ:at,qq=(\d+)\]/);
|
|
2092
|
-
|
|
2092
|
+
if (cqMatch && cqMatch[1]) {
|
|
2093
|
+
targetQQ = cqMatch[1];
|
|
2094
|
+
} else {
|
|
2095
|
+
const textMatch = content.match(/@(\d+)/);
|
|
2096
|
+
if (textMatch && textMatch[1]) {
|
|
2097
|
+
targetQQ = textMatch[1];
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2093
2100
|
if (!targetQQ) {
|
|
2094
|
-
return await session.send(build_msg(session, "
|
|
2101
|
+
return await session.send(build_msg(session, "请@你要挑战的群成员,如:WWC对战@对方昵称"));
|
|
2095
2102
|
}
|
|
2096
2103
|
await doBattleChallenge(ctx, session, targetQQ);
|
|
2097
2104
|
});
|
|
2098
|
-
ctx.command("同意", "
|
|
2105
|
+
ctx.command("同意", "同意对战请求").action(async (argv) => {
|
|
2099
2106
|
const session = argv.session;
|
|
2100
2107
|
if (!session) return;
|
|
2101
2108
|
const qq = session.userId?.toString();
|
|
@@ -2104,13 +2111,13 @@ async function apply(ctx, config) {
|
|
|
2104
2111
|
}
|
|
2105
2112
|
await doBattleAgree(ctx, session);
|
|
2106
2113
|
});
|
|
2107
|
-
ctx.command("拒绝", "
|
|
2114
|
+
ctx.command("拒绝", "拒绝对战请求").action(async (argv) => {
|
|
2108
2115
|
const session = argv.session;
|
|
2109
2116
|
if (!session) return;
|
|
2110
2117
|
const qq = session.userId?.toString();
|
|
2111
2118
|
if (qq && battlePending2.has(qq)) {
|
|
2112
2119
|
battlePending2.delete(qq);
|
|
2113
|
-
await session.send(build_msg(session, "
|
|
2120
|
+
await session.send(build_msg(session, "已拒绝对战请求"));
|
|
2114
2121
|
} else {
|
|
2115
2122
|
await session.send(build_msg(session, "没有待处理的对战请求"));
|
|
2116
2123
|
}
|