koishi-plugin-starfx-bot 0.18.0 → 0.18.1

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
@@ -308,8 +308,9 @@ async function getImageFromUrl(ctx, url) {
308
308
  }
309
309
  __name(getImageFromUrl, "getImageFromUrl");
310
310
  async function atNotSayReply(cfg, session, elements) {
311
- if ((cfg.atNotSay || cfg.atNotSayOther) && elements.length === 1 && elements[0].type === "at") {
312
- const isAtSelf = elements[0].attrs.id === session.selfId;
311
+ const trimElements = elements.filter((e) => !(e.type === "text" && /^\s*$/.test(e.attrs.content)));
312
+ if ((cfg.atNotSay || cfg.atNotSayOther) && trimElements.length === 1 && trimElements[0].type === "at") {
313
+ const isAtSelf = trimElements[0].attrs.id === session.selfId;
313
314
  if (isAtSelf && cfg.atNotSay && import_koishi.Random.bool(cfg.atNotSayProperty)) {
314
315
  await session.send(session.text("middleware.messages.atNotReply"));
315
316
  } else if (!isAtSelf && cfg.atNotSayOther && import_koishi.Random.bool(cfg.atNotSayOtherProperty)) {
@@ -937,6 +938,10 @@ function apply(ctx, cfg) {
937
938
  });
938
939
  if (process.env.NODE_ENV === "development") {
939
940
  ctx.command("test").action(async ({ session }) => {
941
+ await session.send(" d d ");
942
+ });
943
+ ctx.middleware(async (session, next) => {
944
+ return next();
940
945
  });
941
946
  }
942
947
  function initAssets() {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "contributors": [
5
5
  "StarFreedomX <starfreedomx@outlook.com>"
6
6
  ],
7
- "version": "0.18.0",
7
+ "version": "0.18.1",
8
8
  "main": "lib/index.js",
9
9
  "typings": "lib/index.d.ts",
10
10
  "files": [
package/readme.md CHANGED
@@ -107,3 +107,4 @@ StarFreedomX机器人的小功能,自用
107
107
  | `0.17.0` | 语录功能新增链接,可以配置权重 |
108
108
  | `0.17.1` | 修复语录链接跨群bug |
109
109
  | `0.18.0` | 新增定时echo |
110
+ | `0.18.1` | 修复艾特不说话功能 |