mioki 0.6.2 → 0.6.3
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 +16 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +16 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
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.3";
|
|
890
890
|
|
|
891
891
|
//#endregion
|
|
892
892
|
//#region src/actions.ts
|
|
@@ -1736,21 +1736,25 @@ async function start(options = {}) {
|
|
|
1736
1736
|
process.on("uncaughtException", async (err) => {
|
|
1737
1737
|
const msg = stringifyError(err);
|
|
1738
1738
|
napcat.logger.error(`uncaughtException, 出错了: ${msg}`);
|
|
1739
|
-
if (
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
napcat.
|
|
1743
|
-
|
|
1739
|
+
if (botConfig.error_push) {
|
|
1740
|
+
if (Date.now() - lastNoticeTime < 1e3) return;
|
|
1741
|
+
lastNoticeTime = Date.now();
|
|
1742
|
+
await noticeMainOwner(napcat, `mioki 发生未捕获异常:\n\n${msg}`).catch(() => {
|
|
1743
|
+
napcat.logger.error("发送未捕获异常通知失败");
|
|
1744
|
+
});
|
|
1745
|
+
}
|
|
1744
1746
|
});
|
|
1745
1747
|
process.on("unhandledRejection", async (err) => {
|
|
1746
1748
|
const msg = stringifyError(err);
|
|
1747
1749
|
napcat.logger.error(`unhandledRejection, 出错了: ${msg}`);
|
|
1748
|
-
if (
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
napcat.
|
|
1753
|
-
|
|
1750
|
+
if (botConfig.error_push) {
|
|
1751
|
+
if (Date.now() - lastNoticeTime < 1e3) return;
|
|
1752
|
+
lastNoticeTime = Date.now();
|
|
1753
|
+
const date = (/* @__PURE__ */ new Date()).toLocaleString();
|
|
1754
|
+
await noticeMainOwner(napcat, `【${date}】\n\nmioki 发生未处理异常:\n\n${msg}`).catch(() => {
|
|
1755
|
+
napcat.logger.error("发送未处理异常通知失败");
|
|
1756
|
+
});
|
|
1757
|
+
}
|
|
1754
1758
|
});
|
|
1755
1759
|
ensurePluginDir();
|
|
1756
1760
|
const plugins = botConfig.plugins.map((p) => ({
|