koishi-plugin-echo-cave 1.9.0 → 1.9.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.cjs +27 -18
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -68,6 +68,12 @@ var require_zh_CN = __commonJS({
|
|
|
68
68
|
senderDeleteDenied: "\u26D4 \u60A8\u6CA1\u6709\u6743\u9650\u5220\u9664\u6B64\u6D88\u606F\uFF01\u5F53\u524D\u914D\u7F6E\u4E0D\u5141\u8BB8\u539F\u59CB\u53D1\u9001\u8005\u5220\u9664\u56DE\u58F0\u6D1E\u3002",
|
|
69
69
|
msgDeleted: "\u2705 \u5DF2\u6210\u529F\u62B9\u53BB\u56DE\u58F0\u6D1E\u6D88\u606F ID\uFF1A{0}"
|
|
70
70
|
}
|
|
71
|
+
},
|
|
72
|
+
"cave.listen": {
|
|
73
|
+
description: "\u83B7\u5F97\u7531\u81EA\u5DF1\u6295\u7A3F\u7684\u56DE\u58F0\u6D1E\u5217\u8868",
|
|
74
|
+
messages: {
|
|
75
|
+
noMsgContributed: '\u{1F680} \u60A8\u5728\u56DE\u58F0\u6D1E\u4E2D\u6682\u65E0\u6295\u7A3F\uFF0C\u5FEB\u4F7F\u7528 "cave.echo" \u547D\u4EE4\u6DFB\u52A0\u7B2C\u4E00\u6761\u6D88\u606F\u5427\uFF01'
|
|
76
|
+
}
|
|
71
77
|
}
|
|
72
78
|
}
|
|
73
79
|
};
|
|
@@ -300,20 +306,25 @@ async function processForwardMessageContent(ctx, msg) {
|
|
|
300
306
|
|
|
301
307
|
// src/msg-helper.ts
|
|
302
308
|
async function processMessageContent(ctx, msg) {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
309
|
+
const result = [];
|
|
310
|
+
for (const element of msg) {
|
|
311
|
+
if (element.type === "reply") {
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
if (element.type === "image") {
|
|
315
|
+
const newUrl = await saveImages(ctx, element.data);
|
|
316
|
+
result.push({
|
|
317
|
+
...element,
|
|
318
|
+
data: {
|
|
319
|
+
...element.data,
|
|
320
|
+
url: newUrl
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
} else {
|
|
324
|
+
result.push(element);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return result;
|
|
317
328
|
}
|
|
318
329
|
|
|
319
330
|
// src/index.ts
|
|
@@ -360,9 +371,7 @@ function apply(ctx, cfg) {
|
|
|
360
371
|
ctx.command("cave.wipe <id:number>").action(
|
|
361
372
|
async ({ session }, id) => await deleteCave(ctx, session, cfg, id)
|
|
362
373
|
);
|
|
363
|
-
ctx.command("cave.listen"
|
|
364
|
-
async ({ session }) => await getCaveListByUser(ctx, session)
|
|
365
|
-
);
|
|
374
|
+
ctx.command("cave.listen").action(async ({ session }) => await getCaveListByUser(ctx, session));
|
|
366
375
|
ctx.command("cave.trace", "\u83B7\u5F97\u81EA\u5DF1\u53D1\u8A00\u7684\u56DE\u58F0\u6D1E\u5217\u8868").action(
|
|
367
376
|
async ({ session }) => await getCaveListByOriginUser(ctx, session)
|
|
368
377
|
);
|
|
@@ -377,7 +386,7 @@ async function getCaveListByUser(ctx, session) {
|
|
|
377
386
|
channelId
|
|
378
387
|
});
|
|
379
388
|
if (caves.length === 0) {
|
|
380
|
-
return
|
|
389
|
+
return session.text(".noMsgContributed");
|
|
381
390
|
}
|
|
382
391
|
let response = `\u{1F4DC} \u60A8\u5728\u672C\u9891\u9053\u6295\u7A3F\u7684\u56DE\u58F0\u6D1E\u6D88\u606F\u5217\u8868\uFF1A
|
|
383
392
|
`;
|