koishi-plugin-node-async-bot-all 2.8.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/index.d.ts +1 -0
- package/lib/index.js +7 -5
- package/package.json +1 -1
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
|
|
|
@@ -221,6 +221,7 @@ async function getServer(ctx, session) {
|
|
|
221
221
|
let count = 0;
|
|
222
222
|
let list = "";
|
|
223
223
|
for (const item of api) {
|
|
224
|
+
const note = ctx.config.cxV2[index]["note"][count];
|
|
224
225
|
count++;
|
|
225
226
|
try {
|
|
226
227
|
const response = await fetchWithTimeout(item, {}, ctx.config.timeout, log);
|
|
@@ -233,7 +234,7 @@ async function getServer(ctx, session) {
|
|
|
233
234
|
"count": count,
|
|
234
235
|
"players": data["players"],
|
|
235
236
|
"version": data["version"],
|
|
236
|
-
"
|
|
237
|
+
"note": note ?? "无"
|
|
237
238
|
};
|
|
238
239
|
log.info(`Server ${count}:`);
|
|
239
240
|
log.info(temp);
|
|
@@ -244,7 +245,7 @@ async function getServer(ctx, session) {
|
|
|
244
245
|
"players": data["players"],
|
|
245
246
|
"version": data["version"],
|
|
246
247
|
"list": data["list"].join(", "),
|
|
247
|
-
"
|
|
248
|
+
"note": note ?? "无"
|
|
248
249
|
};
|
|
249
250
|
log.info(`Server ${count}:`);
|
|
250
251
|
log.info(temp);
|
|
@@ -486,7 +487,7 @@ async function serverTest(ctx, session) {
|
|
|
486
487
|
__name(serverTest, "serverTest");
|
|
487
488
|
|
|
488
489
|
// package.json
|
|
489
|
-
var version = "2.
|
|
490
|
+
var version = "2.9.0";
|
|
490
491
|
|
|
491
492
|
// src/index.ts
|
|
492
493
|
var inject = ["database"];
|
|
@@ -500,7 +501,8 @@ var Config = import_koishi2.Schema.intersect([
|
|
|
500
501
|
cxV2: import_koishi2.Schema.array(
|
|
501
502
|
import_koishi2.Schema.object({
|
|
502
503
|
id: import_koishi2.Schema.string().required().description("查询 群"),
|
|
503
|
-
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("查询 备注")
|
|
504
506
|
})
|
|
505
507
|
).default([]).description("查询的 API 和 群")
|
|
506
508
|
}).description("查询"),
|