koishi-plugin-echo-cave 1.18.2 → 1.18.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 +5 -7
  2. package/package.json +1 -1
package/lib/index.cjs CHANGED
@@ -818,7 +818,6 @@ async function bindUsersToCave(ctx, session, id, userIds) {
818
818
  }
819
819
 
820
820
  // src/core/command/search-cave.ts
821
- var import_koishi2 = require("koishi");
822
821
  async function searchCave(ctx, session, userIds) {
823
822
  if (!session.guildId) {
824
823
  return session.text("echo-cave.general.privateChatReminder");
@@ -840,12 +839,11 @@ async function searchCave(ctx, session, userIds) {
840
839
  }
841
840
  const targetUserId = parsedUserIds[0];
842
841
  const { channelId } = session;
843
- const matchingCaves = await ctx.database.get(
844
- "echo_cave",
845
- (row) => import_koishi2.$.and(
846
- import_koishi2.$.eq(row.channelId, channelId),
847
- import_koishi2.$.or(import_koishi2.$.eq(row.originUserId, targetUserId), import_koishi2.$.in(targetUserId, row.relatedUsers))
848
- )
842
+ const caves = await ctx.database.get("echo_cave", {
843
+ channelId
844
+ });
845
+ const matchingCaves = caves.filter(
846
+ (cave) => cave.originUserId === targetUserId || cave.relatedUsers.includes(targetUserId)
849
847
  );
850
848
  if (matchingCaves.length === 0) {
851
849
  return session.text(".noMatchingCaves", [targetUserId]);
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.18.2",
4
+ "version": "1.18.3",
5
5
  "main": "lib/index.cjs",
6
6
  "typings": "lib/index.d.ts",
7
7
  "type": "module",