mioki 0.10.0 → 0.10.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 +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +14 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -4
- package/dist/index.d.mts +15 -5
- package/dist/index.mjs +9 -10
- package/dist/index.mjs.map +1 -1
- package/dist/{package-C9ZLKmlF.cjs → package-CnbU34HA.cjs} +2 -2
- package/dist/package-CnbU34HA.cjs.map +1 -0
- package/dist/package-pNCdmvkN.mjs +6 -0
- package/dist/package-pNCdmvkN.mjs.map +1 -0
- package/package.json +2 -2
- package/dist/package-C9ZLKmlF.cjs.map +0 -1
- package/dist/package-HADFnNFP.mjs +0 -6
- package/dist/package-HADFnNFP.mjs.map +0 -1
package/dist/cli.cjs
CHANGED
package/dist/cli.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_package = require('./package-
|
|
1
|
+
const require_package = require('./package-CnbU34HA.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");
|
|
@@ -10,11 +10,11 @@ mri = require_package.__toESM(mri);
|
|
|
10
10
|
let node_crypto = require("node:crypto");
|
|
11
11
|
node_crypto = require_package.__toESM(node_crypto);
|
|
12
12
|
let lowdb = require("lowdb");
|
|
13
|
+
let napcat_sdk = require("napcat-sdk");
|
|
13
14
|
let lowdb_node = require("lowdb/node");
|
|
14
15
|
let jiti = require("jiti");
|
|
15
16
|
let string2argv = require("string2argv");
|
|
16
17
|
let node_url = require("node:url");
|
|
17
|
-
let napcat_sdk = require("napcat-sdk");
|
|
18
18
|
let pretty_ms = require("pretty-ms");
|
|
19
19
|
pretty_ms = require_package.__toESM(pretty_ms);
|
|
20
20
|
let filesize = require("filesize");
|
|
@@ -1408,6 +1408,7 @@ async function formatMiokiStatus(status) {
|
|
|
1408
1408
|
const diskValid = disk.total > 0 && disk.free >= 0;
|
|
1409
1409
|
const diskDesc = `${disk.percent}%-${(0, filesize.filesize)(disk.used, { round: 1 })}/${(0, filesize.filesize)(disk.total, { round: 1 })}`;
|
|
1410
1410
|
return `
|
|
1411
|
+
〓 🟢 mioki 状态 〓
|
|
1411
1412
|
👤 ${bot.nickname}
|
|
1412
1413
|
🆔 ${bot.uin}
|
|
1413
1414
|
📋 ${localNum(bot.friends)} 好友 / ${localNum(bot.groups)} 群
|
|
@@ -1485,7 +1486,7 @@ function getCpuInfo() {
|
|
|
1485
1486
|
|
|
1486
1487
|
//#endregion
|
|
1487
1488
|
//#region src/builtins/core/index.ts
|
|
1488
|
-
const
|
|
1489
|
+
const CORE_PLUGINS = ["mioki-core"];
|
|
1489
1490
|
const core = definePlugin({
|
|
1490
1491
|
name: "mioki-core",
|
|
1491
1492
|
version: require_package.version,
|
|
@@ -1497,17 +1498,15 @@ const core = definePlugin({
|
|
|
1497
1498
|
const statusAdminOnly = ctx.botConfig.status_permission === "admin-only";
|
|
1498
1499
|
let statusFormatter = (status) => formatMiokiStatus(status);
|
|
1499
1500
|
ctx.addService("getMiokiStatus", () => getMiokiStatus(ctx.bot));
|
|
1500
|
-
ctx.addService("formatMiokiStatus", formatMiokiStatus);
|
|
1501
|
-
ctx.addService("customFormatMiokiStatus", (formatter) =>
|
|
1502
|
-
statusFormatter = formatter;
|
|
1503
|
-
});
|
|
1501
|
+
ctx.addService("formatMiokiStatus", (status) => formatMiokiStatus(status));
|
|
1502
|
+
ctx.addService("customFormatMiokiStatus", (formatter) => statusFormatter = formatter);
|
|
1504
1503
|
ctx.handle("message", (e) => ctx.runWithErrorHandler(async () => {
|
|
1505
1504
|
const text$1 = ctx.text(e);
|
|
1506
1505
|
if (!cmdPrefix.test(text$1)) return;
|
|
1507
1506
|
if (statusAdminOnly && !ctx.hasRight(e)) return;
|
|
1508
1507
|
if (text$1.replace(cmdPrefix, "") === "状态") {
|
|
1509
1508
|
const status = await statusFormatter(await getMiokiStatus(ctx.bot));
|
|
1510
|
-
await e.reply(
|
|
1509
|
+
await e.reply(status);
|
|
1511
1510
|
return;
|
|
1512
1511
|
}
|
|
1513
1512
|
if (!ctx.isOwner(e)) return;
|
|
@@ -1526,7 +1525,7 @@ const core = definePlugin({
|
|
|
1526
1525
|
`).trim());
|
|
1527
1526
|
break;
|
|
1528
1527
|
case "插件":
|
|
1529
|
-
if (
|
|
1528
|
+
if (CORE_PLUGINS.includes(target)) {
|
|
1530
1529
|
await e.reply("内置插件无法操作", true);
|
|
1531
1530
|
return;
|
|
1532
1531
|
}
|
|
@@ -1884,9 +1883,13 @@ async function start(options = {}) {
|
|
|
1884
1883
|
}
|
|
1885
1884
|
|
|
1886
1885
|
//#endregion
|
|
1886
|
+
exports.ArchMap = ArchMap;
|
|
1887
1887
|
exports.BOT_CWD = BOT_CWD;
|
|
1888
|
+
exports.BUILTIN_PLUGINS = BUILTIN_PLUGINS;
|
|
1889
|
+
exports.CORE_PLUGINS = CORE_PLUGINS;
|
|
1888
1890
|
exports.ChromeUA = ChromeUA;
|
|
1889
1891
|
exports.START_TIME = START_TIME;
|
|
1892
|
+
exports.SystemMap = SystemMap;
|
|
1890
1893
|
exports.addService = addService;
|
|
1891
1894
|
exports.base64Decode = base64Decode;
|
|
1892
1895
|
exports.base64Encode = base64Encode;
|
|
@@ -1941,6 +1944,7 @@ exports.filter = filter;
|
|
|
1941
1944
|
exports.find = find;
|
|
1942
1945
|
exports.findLocalPlugins = findLocalPlugins;
|
|
1943
1946
|
exports.formatDuration = formatDuration;
|
|
1947
|
+
exports.formatMiokiStatus = formatMiokiStatus;
|
|
1944
1948
|
exports.formatQQLevel = formatQQLevel;
|
|
1945
1949
|
Object.defineProperty(exports, 'fs', {
|
|
1946
1950
|
enumerable: true,
|
|
@@ -1961,6 +1965,7 @@ exports.getMentionedImageUrl = getMentionedImageUrl;
|
|
|
1961
1965
|
exports.getMentionedUserId = getMentionedUserId;
|
|
1962
1966
|
exports.getMinicoTokenViaAuthCode = getMinicoTokenViaAuthCode;
|
|
1963
1967
|
exports.getMiokiLogger = getMiokiLogger;
|
|
1968
|
+
exports.getMiokiStatus = getMiokiStatus;
|
|
1964
1969
|
exports.getQQAvatarLink = getQQAvatarLink;
|
|
1965
1970
|
exports.getQuoteImage = getQuoteImage;
|
|
1966
1971
|
exports.getQuoteImageUrl = getQuoteImageUrl;
|