koishi-plugin-best-cave 2.5.0 → 2.5.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.
Files changed (2) hide show
  1. package/lib/index.js +4 -6
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -1076,12 +1076,10 @@ function apply(ctx, config) {
1076
1076
  });
1077
1077
  cave.subcommand(".add [content:text]", "添加回声洞").usage("添加一条回声洞。可直接发送内容,也可回复或引用消息。").action(async ({ session }, content) => {
1078
1078
  try {
1079
- let sourceElements;
1080
- if (session.quote?.elements) {
1081
- sourceElements = session.quote.elements;
1082
- } else if (content?.trim()) {
1083
- sourceElements = import_koishi3.h.parse(content);
1084
- } else {
1079
+ let sourceElements = [];
1080
+ if (content?.trim()) sourceElements.push(...import_koishi3.h.parse(content));
1081
+ if (session.quote?.elements) sourceElements.push(...session.quote.elements);
1082
+ if (sourceElements.length === 0) {
1085
1083
  await session.send("请在一分钟内发送你要添加的内容");
1086
1084
  const reply = await session.prompt(6e4);
1087
1085
  if (!reply) return "等待操作超时";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-best-cave",
3
3
  "description": "功能强大、高度可定制的回声洞。支持丰富的媒体类型、内容查重、人工审核、用户昵称、数据迁移以及本地/S3 双重文件存储后端。",
4
- "version": "2.5.0",
4
+ "version": "2.5.1",
5
5
  "contributors": [
6
6
  "Yis_Rime <yis_rime@outlook.com>"
7
7
  ],