koishi-plugin-node-async-bot-all 2.7.0 → 2.9.0
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/fun.d.ts +0 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +8 -8
- package/package.json +1 -1
package/lib/fun.d.ts
CHANGED
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -34,7 +34,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
34
34
|
// src/locales/zh-CN.yml
|
|
35
35
|
var require_zh_CN = __commonJS({
|
|
36
36
|
"src/locales/zh-CN.yml"(exports2, module2) {
|
|
37
|
-
module2.exports = { commands: { cx: { description: "查询服务器当前人数。", messages: { msg: "{time}{list}\n进服指南请在群公告中查看。", list: "【MC 服务器 {count}】\n➣ {version}:{players}\n➣ 玩家列表:{list}\n➣
|
|
37
|
+
module2.exports = { commands: { cx: { description: "查询服务器当前人数。", messages: { msg: "{time}{list}\n进服指南请在群公告中查看。", list: "【MC 服务器 {count}】\n➣ {version}:{players}\n➣ 玩家列表:{list}\n➣ 备注:{note}", listNoPlayer: "【MC 服务器 {count}】\n➣ {version}:{players}\n➣ 备注:{note}", listFailed: "【MC 服务器 {count}】\n➣ 查询失败:{data}\n➣ 请稍后重试。", forbidden: "{time}\n此指令不允许在本群使用。", failed: "{time}\n查询失败:{data}", timeout: "请求超时。", timeout2: "响应超时。", fewData: "服务端返回的数据过少。", close: "服务器已关闭。", error: "执行错误。", unknown: "未知错误。", host: "没有到主机的路由。" } }, status: { description: "查询机器人状态。", messages: { msg: "{time}\n--- 系统状态 ---\n系统名称:{name}\nCPU使用率:{cpu}\n内存使用率:{memory}\n--- 机器人状态 ---\n昨日收/发消息数量:{msgCount}\n机器人版本:{version}\n运行时间:{online}", failed: "{time}\n状态获取失败。" } }, random: { description: "随机数生成器。", usage: "缺少参数时默认生成 0-10000 的随机数。\n使用示例:", examples: "random 1 128 生成1到128范围的随机数", messages: { msg: "{time}\n生成的随机数:{data}" } }, info: { description: "查询机器人信息。", messages: { msg: "{data}", failed: "{time}\n读取信息失败。" } }, rw: { description: "随机名言名句。", messages: { msg: "{time}\n{data}", failed1: "{time}\n获取失败(1)。", failed2: "{time}\n获取失败(2)。" } }, randomba: { description: "随机BA图。", messages: { wait: "{time}\n请等待图片上传(可能较慢)。" } }, servertest: { description: "Ping服务器。", messages: { msg: "{time}\n== Ping {host} ==\n状态:{alive}\n丢包率:{packetLoss}\n返回IP:{ip}", forbidden: "{time}\n此指令不允许在本群使用。", failed: "{time}\nPing 失败:{data}" } } } };
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
|
|
@@ -185,7 +185,6 @@ async function hostPing(host) {
|
|
|
185
185
|
"success": true,
|
|
186
186
|
"ip": tmp.numeric_host,
|
|
187
187
|
"alive": tmp.alive,
|
|
188
|
-
"time": tmp.avg == "unknown" ? "请求超时。" : `平均延迟:${tmp.avg}ms`,
|
|
189
188
|
"packetLoss": tmp.packetLoss.toString()
|
|
190
189
|
};
|
|
191
190
|
} catch (error) {
|
|
@@ -222,6 +221,7 @@ async function getServer(ctx, session) {
|
|
|
222
221
|
let count = 0;
|
|
223
222
|
let list = "";
|
|
224
223
|
for (const item of api) {
|
|
224
|
+
const note = ctx.config.cxV2[index]["note"][count];
|
|
225
225
|
count++;
|
|
226
226
|
try {
|
|
227
227
|
const response = await fetchWithTimeout(item, {}, ctx.config.timeout, log);
|
|
@@ -234,7 +234,7 @@ async function getServer(ctx, session) {
|
|
|
234
234
|
"count": count,
|
|
235
235
|
"players": data["players"],
|
|
236
236
|
"version": data["version"],
|
|
237
|
-
"
|
|
237
|
+
"note": note ?? "无"
|
|
238
238
|
};
|
|
239
239
|
log.info(`Server ${count}:`);
|
|
240
240
|
log.info(temp);
|
|
@@ -245,7 +245,7 @@ async function getServer(ctx, session) {
|
|
|
245
245
|
"players": data["players"],
|
|
246
246
|
"version": data["version"],
|
|
247
247
|
"list": data["list"].join(", "),
|
|
248
|
-
"
|
|
248
|
+
"note": note ?? "无"
|
|
249
249
|
};
|
|
250
250
|
log.info(`Server ${count}:`);
|
|
251
251
|
log.info(temp);
|
|
@@ -481,14 +481,13 @@ async function serverTest(ctx, session) {
|
|
|
481
481
|
"host": host,
|
|
482
482
|
"ip": tmp.ip,
|
|
483
483
|
"alive": tmp.alive == true ? "正常" : "异常",
|
|
484
|
-
"packetLoss": tmp.packetLoss
|
|
485
|
-
"avg": tmp.time
|
|
484
|
+
"packetLoss": tmp.packetLoss
|
|
486
485
|
};
|
|
487
486
|
}
|
|
488
487
|
__name(serverTest, "serverTest");
|
|
489
488
|
|
|
490
489
|
// package.json
|
|
491
|
-
var version = "2.
|
|
490
|
+
var version = "2.9.0";
|
|
492
491
|
|
|
493
492
|
// src/index.ts
|
|
494
493
|
var inject = ["database"];
|
|
@@ -502,7 +501,8 @@ var Config = import_koishi2.Schema.intersect([
|
|
|
502
501
|
cxV2: import_koishi2.Schema.array(
|
|
503
502
|
import_koishi2.Schema.object({
|
|
504
503
|
id: import_koishi2.Schema.string().required().description("查询 群"),
|
|
505
|
-
api: import_koishi2.Schema.array(String).description("查询 API")
|
|
504
|
+
api: import_koishi2.Schema.array(String).description("查询 API"),
|
|
505
|
+
note: import_koishi2.Schema.array(String).description("查询 备注")
|
|
506
506
|
})
|
|
507
507
|
).default([]).description("查询的 API 和 群")
|
|
508
508
|
}).description("查询"),
|