mioki 0.6.0 → 0.6.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/index.cjs +15 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.mjs +15 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/readme.md +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -521,6 +521,8 @@ interface MiokiStatus {
|
|
|
521
521
|
bot: {
|
|
522
522
|
uin: number;
|
|
523
523
|
nickname: string;
|
|
524
|
+
friends: number;
|
|
525
|
+
groups: number;
|
|
524
526
|
};
|
|
525
527
|
plugins: {
|
|
526
528
|
enabled: number;
|
|
@@ -528,6 +530,8 @@ interface MiokiStatus {
|
|
|
528
530
|
};
|
|
529
531
|
stats: {
|
|
530
532
|
uptime: number;
|
|
533
|
+
send: number;
|
|
534
|
+
receive: number;
|
|
531
535
|
};
|
|
532
536
|
versions: {
|
|
533
537
|
node: string;
|
package/dist/index.mjs
CHANGED
|
@@ -886,7 +886,7 @@ function getMiokiLogger(level) {
|
|
|
886
886
|
|
|
887
887
|
//#endregion
|
|
888
888
|
//#region package.json
|
|
889
|
-
var version = "0.6.
|
|
889
|
+
var version = "0.6.2";
|
|
890
890
|
|
|
891
891
|
//#endregion
|
|
892
892
|
//#region src/actions.ts
|
|
@@ -1288,10 +1288,12 @@ async function getMiokiStatus(bot) {
|
|
|
1288
1288
|
const osArch = os.arch();
|
|
1289
1289
|
const isInUnix = ["Linux", "Darwin"].includes(osType);
|
|
1290
1290
|
const arch = ArchMap[osArch] || osArch;
|
|
1291
|
-
const [osInfo, localPlugins, versionInfo] = await Promise.all([
|
|
1291
|
+
const [osInfo, localPlugins, versionInfo, friendList, groupList] = await Promise.all([
|
|
1292
1292
|
systemInfo.osInfo(),
|
|
1293
1293
|
findLocalPlugins(),
|
|
1294
|
-
bot.getVersionInfo()
|
|
1294
|
+
bot.getVersionInfo(),
|
|
1295
|
+
bot.getFriendList(),
|
|
1296
|
+
bot.getGroupList()
|
|
1295
1297
|
]);
|
|
1296
1298
|
const pluginCount = localPlugins.length + BUILTIN_PLUGINS.length;
|
|
1297
1299
|
const system = isInUnix ? {
|
|
@@ -1309,13 +1311,19 @@ async function getMiokiStatus(bot) {
|
|
|
1309
1311
|
return {
|
|
1310
1312
|
bot: {
|
|
1311
1313
|
uin: bot.uin,
|
|
1312
|
-
nickname: bot.nickname
|
|
1314
|
+
nickname: bot.nickname,
|
|
1315
|
+
friends: friendList.length,
|
|
1316
|
+
groups: groupList.length
|
|
1313
1317
|
},
|
|
1314
1318
|
plugins: {
|
|
1315
1319
|
enabled: runtimePlugins.size,
|
|
1316
1320
|
total: pluginCount
|
|
1317
1321
|
},
|
|
1318
|
-
stats: {
|
|
1322
|
+
stats: {
|
|
1323
|
+
uptime: process.uptime() * 1e3,
|
|
1324
|
+
send: bot.stat.send.group + bot.stat.send.private,
|
|
1325
|
+
receive: bot.stat.recv.group + bot.stat.recv.private
|
|
1326
|
+
},
|
|
1319
1327
|
versions: {
|
|
1320
1328
|
node: nodeVersion,
|
|
1321
1329
|
mioki: version,
|
|
@@ -1356,7 +1364,9 @@ async function getMiokiStatusStr(client) {
|
|
|
1356
1364
|
return `
|
|
1357
1365
|
👤 ${bot.nickname}
|
|
1358
1366
|
🆔 ${bot.uin}
|
|
1367
|
+
📋 ${localNum(bot.friends)} 好友 / ${localNum(bot.groups)} 群
|
|
1359
1368
|
🧩 启用了 ${localNum(plugins.enabled)} 个插件,共 ${localNum(plugins.total)} 个
|
|
1369
|
+
📮 收 ${localNum(stats.receive)} 条,发 ${localNum(stats.send)} 条
|
|
1360
1370
|
🚀 ${filesize(memory.rss.used, { round: 1 })}/${memory.percent}%
|
|
1361
1371
|
⏳ 已运行 ${pm(stats.uptime, {
|
|
1362
1372
|
hideYear: true,
|