koishi-plugin-prism-neo 0.0.24 → 0.0.25

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.d.ts CHANGED
@@ -4,6 +4,7 @@ export interface Config {
4
4
  url: string;
5
5
  admin: string;
6
6
  broadcasts: string[];
7
+ pmOnLogout: string[];
7
8
  currency: string;
8
9
  autoLockOnLogin: boolean;
9
10
  logoutConfirmation: boolean;
package/lib/index.js CHANGED
@@ -187,6 +187,9 @@ var Config = import_koishi.Schema.object({
187
187
  broadcasts: import_koishi.Schema.array(
188
188
  import_koishi.Schema.string()
189
189
  ),
190
+ pmOnLogout: import_koishi.Schema.array(
191
+ import_koishi.Schema.string()
192
+ ),
190
193
  currency: import_koishi.Schema.string().default("月饼").description("货币名称"),
191
194
  autoLockOnLogin: import_koishi.Schema.boolean().default(true).description("登录时自动获取门锁密码"),
192
195
  logoutConfirmation: import_koishi.Schema.boolean().default(true).description("登出时需要二次确认"),
@@ -370,9 +373,12 @@ async function handleLogoutCmd(context, user) {
370
373
  if (error) return error;
371
374
  if (!context.config.logoutConfirmation) {
372
375
  const res = await logout(context, targetUserId);
373
- let message = user ? `✅ 已为用户 ${await getUserName(context.session, targetUserId)} 退场` : "✅ 退场成功";
376
+ let name2 = await getUserName(context.session, targetUserId);
377
+ let message = user ? `✅ 已为用户 ${name2} 退场` : "✅ 退场成功";
374
378
  message += "\n";
375
379
  message += formatBilling(res, context.config.currency);
380
+ await context.session.bot.broadcast(context.config.pmOnLogout, `${name2}
381
+ ${message}`);
376
382
  return message;
377
383
  }
378
384
  const pendingLogout = kv.get(targetUserId);
@@ -667,7 +673,7 @@ function apply(ctx, config) {
667
673
  let machines = await getAllMachinePower({ ctx, config });
668
674
  let turnOff = false;
669
675
  machines.forEach((m) => {
670
- if (m.state.state === "on") {
676
+ if (m.state.state !== "off") {
671
677
  turnOff = true;
672
678
  }
673
679
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-prism-neo",
3
3
  "description": "prism koishi前端",
4
- "version": "0.0.24",
4
+ "version": "0.0.25",
5
5
  "main": "lib/index.js",
6
6
  "files": [
7
7
  "lib",