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.
Files changed (2) hide show
  1. package/lib/index.js +7 -11
  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";
@@ -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 cqMatch = content.match(/\[CQ:at,qq=(\d+)\]/i);
2092
- if (cqMatch) {
2093
- targetQQ = cqMatch[1];
2094
- } else {
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, "请@你要挑战的人,如:WWC对战@123456"));
2097
+ return await session.send(build_msg(session, "请@你要挑战的人"));
2102
2098
  }
2103
2099
  await doBattleChallenge(ctx, session, targetQQ);
2104
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.7",
4
+ "version": "0.2.9",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [