koishi-plugin-node-async-bot-all 1.4.1 → 1.4.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/lib/index.js +13 -18
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -39,7 +39,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
39
39
|
var import_os = __toESM(require("os"));
|
|
40
40
|
|
|
41
41
|
// package.json
|
|
42
|
-
var version = "1.4.
|
|
42
|
+
var version = "1.4.2";
|
|
43
43
|
|
|
44
44
|
// res/i18n.yaml
|
|
45
45
|
var i18n_default = { rw: { failed1: "获取失败(1)。", failed2: "获取失败(2)。" }, cx: { forbidden: "此指令不允许在本群使用。", notice: "进服指南请在群公告中查看。", players: "服务器当前人数", failed: "查询失败:", timeout: "请求超时。", later: "请稍后重试。", unknown: "未知错误。" }, status: { failed: "状态获取失败。", name: "系统名称:", cpu: "CPU使用率:", memory: "内存使用率:" }, random: { sc: "生成的随机数:" }, info: { failed: "读取信息失败。" } };
|
|
@@ -81,23 +81,18 @@ ${i18n_default.status.memory}${getMemoryUsage()}%`;
|
|
|
81
81
|
}
|
|
82
82
|
__name(getSystemUsage, "getSystemUsage");
|
|
83
83
|
function getHongKongTime() {
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const partMap = {};
|
|
97
|
-
parts.forEach((part) => {
|
|
98
|
-
partMap[part.type] = part.value;
|
|
99
|
-
});
|
|
100
|
-
return `${partMap.year}-${partMap.month}-${partMap.day} ${partMap.hour}:${partMap.minute}:${partMap.second}`;
|
|
84
|
+
const now = /* @__PURE__ */ new Date();
|
|
85
|
+
const hkOffset = 8 * 60;
|
|
86
|
+
const hkTime = new Date(now.getTime() + (hkOffset + now.getTimezoneOffset()) * 6e4);
|
|
87
|
+
return [
|
|
88
|
+
hkTime.getFullYear(),
|
|
89
|
+
(hkTime.getMonth() + 1).toString().padStart(2, "0"),
|
|
90
|
+
hkTime.getDate().toString().padStart(2, "0")
|
|
91
|
+
].join("-") + " " + [
|
|
92
|
+
hkTime.getHours().toString().padStart(2, "0"),
|
|
93
|
+
hkTime.getMinutes().toString().padStart(2, "0"),
|
|
94
|
+
hkTime.getSeconds().toString().padStart(2, "0")
|
|
95
|
+
].join(":");
|
|
101
96
|
}
|
|
102
97
|
__name(getHongKongTime, "getHongKongTime");
|
|
103
98
|
async function fetchWithTimeout(url, options = {}, timeout = 5e3) {
|