koishi-plugin-echo-cave 1.6.2 → 1.6.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 +6 -1
  2. package/package.json +1 -1
package/lib/index.cjs CHANGED
@@ -353,7 +353,12 @@ async function deleteCave(ctx, session, id) {
353
353
  }
354
354
  const caveMsg = caves[0];
355
355
  const currentUserId = session.userId;
356
- if (currentUserId !== caveMsg.userId && currentUserId !== caveMsg.originUserId && (await session.getUser(currentUserId)).authority < 4) {
356
+ const user = await this.ctx.database.getUser(
357
+ session.platform,
358
+ currentUserId
359
+ );
360
+ const userAuthority = user.authority;
361
+ if (currentUserId !== caveMsg.userId && currentUserId !== caveMsg.originUserId && userAuthority < 4) {
357
362
  return "\u26D4 \u60A8\u6CA1\u6709\u6743\u9650\u5220\u9664\u6B64\u6D88\u606F\uFF01\u53EA\u6709\u6D88\u606F\u7684\u5B58\u50A8\u8005\u3001\u539F\u59CB\u53D1\u9001\u8005\u6216\u7BA1\u7406\u5458\u53EF\u4EE5\u5220\u9664\u3002";
358
363
  }
359
364
  await ctx.database.remove("echo_cave", id);
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.6.2",
4
+ "version": "1.6.3",
5
5
  "main": "lib/index.cjs",
6
6
  "typings": "lib/index.d.ts",
7
7
  "type": "module",