koishi-plugin-echo-cave 1.4.0 → 1.4.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 +5 -2
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -276,8 +276,8 @@ async function getCave(ctx, session, id) {
|
|
|
276
276
|
return "\u274C \u8BF7\u5728\u7FA4\u804A\u4E2D\u4F7F\u7528\u8BE5\u547D\u4EE4\uFF01";
|
|
277
277
|
}
|
|
278
278
|
let caveMsg;
|
|
279
|
+
const { channelId } = session;
|
|
279
280
|
if (!id) {
|
|
280
|
-
const { channelId } = session;
|
|
281
281
|
const caves = await ctx.database.get("echo_cave", {
|
|
282
282
|
channelId
|
|
283
283
|
});
|
|
@@ -286,7 +286,10 @@ async function getCave(ctx, session, id) {
|
|
|
286
286
|
}
|
|
287
287
|
caveMsg = caves[Math.floor(Math.random() * caves.length)];
|
|
288
288
|
} else {
|
|
289
|
-
const caves = await ctx.database.get("echo_cave",
|
|
289
|
+
const caves = await ctx.database.get("echo_cave", {
|
|
290
|
+
id,
|
|
291
|
+
channelId
|
|
292
|
+
});
|
|
290
293
|
if (caves.length === 0) {
|
|
291
294
|
return "\u{1F50D} \u672A\u627E\u5230\u8BE5 ID \u7684\u56DE\u58F0\u6D1E\u6D88\u606F";
|
|
292
295
|
}
|