mioki 0.9.0 → 0.9.2

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/dist/cli.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const require_package = require('./package-BMRAnl4f.cjs');
2
+ const require_package = require('./package-hrAht8He.cjs');
3
3
  let node_fs = require("node:fs");
4
4
  node_fs = require_package.__toESM(node_fs);
5
5
  let node_path = require("node:path");
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as version } from "./package-CDtL5_dK.mjs";
2
+ import { t as version } from "./package-BUreTxqg.mjs";
3
3
  import fs from "node:fs";
4
4
  import path from "node:path";
5
5
  import mri from "mri";
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_package = require('./package-BMRAnl4f.cjs');
1
+ const require_package = require('./package-hrAht8He.cjs');
2
2
  let node_fs = require("node:fs");
3
3
  node_fs = require_package.__toESM(node_fs);
4
4
  let node_util = require("node:util");
@@ -975,7 +975,7 @@ async function noticeGroups(bot, groupIdList, message, delay = 1e3) {
975
975
  * 群发好友消息
976
976
  */
977
977
  async function noticeFriends(bot, friendIdList, message, delay = 1e3) {
978
- if (!bot.isOnline) {
978
+ if (!bot.isOnline()) {
979
979
  logger.error("发送失败,Bot 不在线");
980
980
  return;
981
981
  }
@@ -1494,10 +1494,13 @@ const core = definePlugin({
1494
1494
  const prefix = (ctx.botConfig.prefix ?? "#").replace(/[-_.^$?[\]{}]/g, "\\$&");
1495
1495
  const cmdPrefix = /* @__PURE__ */ new RegExp(`^${prefix}`);
1496
1496
  const displayPrefix = prefix.replace(/\\\\/g, "\\");
1497
+ const statusAdminOnly = ctx.botConfig.status_permission === "admin-only";
1497
1498
  ctx.addService("miokiStatus", () => getMiokiStatus(ctx.bot));
1499
+ ctx.addService("miokiStatusStr", () => getMiokiStatusStr(ctx.bot));
1498
1500
  ctx.handle("message", (e) => ctx.runWithErrorHandler(async () => {
1499
1501
  const text$1 = ctx.text(e);
1500
1502
  if (!cmdPrefix.test(text$1)) return;
1503
+ if (statusAdminOnly && !ctx.hasRight(e)) return;
1501
1504
  if (text$1.replace(cmdPrefix, "") === "状态") {
1502
1505
  const status = await getMiokiStatusStr(ctx.bot);
1503
1506
  await e.reply(`〓 🟢 mioki 状态 〓\n${status}`.trim());