koishi-plugin-best-cave 2.5.1 → 2.5.2
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 +6 -4
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1076,10 +1076,12 @@ 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 (
|
|
1081
|
-
|
|
1082
|
-
if (
|
|
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 {
|
|
1083
1085
|
await session.send("请在一分钟内发送你要添加的内容");
|
|
1084
1086
|
const reply = await session.prompt(6e4);
|
|
1085
1087
|
if (!reply) return "等待操作超时";
|