koishi-plugin-xxck-1 0.2.8 → 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.
Files changed (2) hide show
  1. package/lib/index.js +9 -6
  2. 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.card_name })
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
- await session.send(build_msg(session, session.text("draw.broadcast.getCard", { name: showName, star: starText, id: card.card_id, cardName: card.card_id })));
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,11 +2087,14 @@ async function apply(ctx, config) {
2087
2087
  const session = argv.session;
2088
2088
  if (!session) return;
2089
2089
  const content = session.content || "";
2090
- const qqMatch = content.match(/@(\d+)/);
2091
- const cqMatch = content.match(/\[CQ:at,qq=(\d+)\]/);
2092
- const targetQQ = cqMatch?.[1] || qqMatch?.[1] || null;
2090
+ let targetQQ = null;
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;
2095
+ }
2093
2096
  if (!targetQQ) {
2094
- return await session.send(build_msg(session, "请@你要挑战的人,如:WWC对战@123456"));
2097
+ return await session.send(build_msg(session, "请@你要挑战的人"));
2095
2098
  }
2096
2099
  await doBattleChallenge(ctx, session, targetQQ);
2097
2100
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-xxck-1",
3
3
  "description": "自用(?)抽卡系统|完整指令说明见readme|建议使用skia-canvas|指令与本地化已经基本完成",
4
- "version": "0.2.8",
4
+ "version": "0.2.9",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [