koishi-plugin-starfx-bot 0.13.6 → 0.14.0

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 CHANGED
@@ -529,7 +529,11 @@ function apply(ctx, cfg) {
529
529
  if (detectControl(controlJson, session.guildId, "echo")) {
530
530
  const elements = session.elements;
531
531
  try {
532
- elements[0].attrs.content = elements[0].attrs?.content.split(" ").slice(1).join(" ");
532
+ if (elements[0].type === "at") elements.shift();
533
+ elements[0].attrs.content = elements[0].attrs?.content.trim().split(" ").slice(1).join(" ");
534
+ if (elements.length == 1 && !elements[0].attrs.content?.length) {
535
+ return session.quote?.elements;
536
+ }
533
537
  return elements;
534
538
  } catch (e) {
535
539
  return params;
@@ -541,7 +545,7 @@ function apply(ctx, cfg) {
541
545
  ctx.command("bdbd [param]").option("starNum", "-n <starNum: number>").option("color", "-c <color: string>").option("train", "-t <train: string>").option("band", "-b <band: string>").action(async ({ session, options }, param) => {
542
546
  if (detectControl(controlJson, session.guildId, "bdbd")) {
543
547
  const p = session.send("图片处理中请稍等...");
544
- console.log(param.slice(0, 1e3));
548
+ console.log(param?.slice(0, 1e3));
545
549
  const drawConfig = await handleBanGDreamConfig(options);
546
550
  const imgSrc = await getImageSrc(session, param);
547
551
  if (!imgSrc?.length) return "输入无效";
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "contributors": [
5
5
  "StarFreedomX <starfreedomx@outlook.com>"
6
6
  ],
7
- "version": "0.13.6",
7
+ "version": "0.14.0",
8
8
  "main": "lib/index.js",
9
9
  "typings": "lib/index.d.ts",
10
10
  "files": [
package/readme.md CHANGED
@@ -104,3 +104,5 @@ StarFreedomX机器人的小功能,自用
104
104
  | `0.13.4` | Re修订:不再return图片对象,防止$()可能导致的参数溢出 |
105
105
  | `0.13.5` | Re再修订:bdbd新增检测异常机制,防止$()可能导致的问题 |
106
106
  | `0.13.6` | 恢复误注释内容 |
107
+ | `0.13.7` | 修复bdbd无param时出现的异常 |
108
+ | `0.14.0` | echo增加对引用消息的支持,且支持有at触发 |