koishi-plugin-echo-cave 1.7.1 → 1.7.3

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.cjs +15 -10
  2. package/package.json +9 -8
package/lib/index.cjs CHANGED
@@ -212,19 +212,24 @@ async function sendCaveMsg(ctx, session, caveMsg) {
212
212
  ];
213
213
  const random = (arr) => arr[Math.floor(Math.random() * arr.length)];
214
214
  if (caveMsg.type === "forward") {
215
- const chosen = random(forwardStyles);
216
- await session.onebot.sendGroupMsg(channelId, [createTextMsg(chosen)]);
215
+ const chosen2 = random(forwardStyles);
216
+ await session.onebot.sendGroupMsg(channelId, [createTextMsg(chosen2)]);
217
217
  await session.onebot.sendGroupForwardMsg(channelId, content);
218
- } else {
219
- const chosen = random(msgStyles);
220
- const last = content.at(-1);
221
- const needsNewline = last?.type === "text";
222
- content.unshift(createTextMsg(chosen.prefix));
223
- content.push(
224
- createTextMsg(`${needsNewline ? "\n\n" : ""}${chosen.suffix}`)
225
- );
218
+ return;
219
+ } else if (caveMsg.type == "msg" && content.some((m) => m.type === "reply")) {
220
+ const chosen2 = random(forwardStyles);
221
+ await session.onebot.sendGroupMsg(channelId, [createTextMsg(chosen2)]);
226
222
  await session.onebot.sendGroupMsg(channelId, content);
223
+ return;
227
224
  }
225
+ const chosen = random(msgStyles);
226
+ const last = content.at(-1);
227
+ const needsNewline = last?.type === "text";
228
+ content.unshift(createTextMsg(chosen.prefix));
229
+ content.push(
230
+ createTextMsg(`${needsNewline ? "\n\n" : ""}${chosen.suffix}`)
231
+ );
232
+ await session.onebot.sendGroupMsg(channelId, content);
228
233
  }
229
234
  function formatDate(date) {
230
235
  return date.toLocaleDateString("zh-CN", {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-echo-cave",
3
3
  "description": "Group echo cave",
4
- "version": "1.7.1",
4
+ "version": "1.7.3",
5
5
  "main": "lib/index.cjs",
6
6
  "typings": "lib/index.d.ts",
7
7
  "type": "module",
@@ -32,18 +32,19 @@
32
32
  "@semantic-release/changelog": "^6.0.3",
33
33
  "@semantic-release/commit-analyzer": "^13.0.1",
34
34
  "@semantic-release/git": "^10.0.1",
35
- "@semantic-release/npm": "^13.1.1",
35
+ "@semantic-release/npm": "^13.1.2",
36
36
  "@semantic-release/release-notes-generator": "^14.1.0",
37
- "@trivago/prettier-plugin-sort-imports": "^5.2.2",
37
+ "@trivago/prettier-plugin-sort-imports": "^6.0.0",
38
+ "@types/node": "^24.10.1",
38
39
  "conventional-changelog-conventionalcommits": "^9.1.0",
39
- "esbuild": "^0.25.11",
40
+ "esbuild": "^0.27.0",
40
41
  "esbuild-plugin-yaml": "^0.0.1",
41
- "eslint": "^9.38.0",
42
+ "eslint": "^9.39.1",
42
43
  "eslint-config-prettier": "^10.1.8",
43
44
  "eslint-plugin-prettier": "^5.5.4",
44
- "prettier": "^3.6.2",
45
- "semantic-release": "^25.0.1",
45
+ "prettier": "^3.7.2",
46
+ "semantic-release": "^25.0.2",
46
47
  "typescript": "^5.9.3",
47
- "typescript-eslint": "^8.46.2"
48
+ "typescript-eslint": "^8.48.0"
48
49
  }
49
50
  }