mioki 0.6.2 → 0.6.4
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 +17 -13
- 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 +17 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/readme.md +1 -1
package/dist/index.cjs
CHANGED
|
@@ -937,7 +937,7 @@ function getMiokiLogger(level) {
|
|
|
937
937
|
|
|
938
938
|
//#endregion
|
|
939
939
|
//#region package.json
|
|
940
|
-
var version = "0.6.
|
|
940
|
+
var version = "0.6.4";
|
|
941
941
|
|
|
942
942
|
//#endregion
|
|
943
943
|
//#region src/actions.ts
|
|
@@ -1756,7 +1756,7 @@ async function start(options = {}) {
|
|
|
1756
1756
|
const plugin_dir = getAbsPluginDir();
|
|
1757
1757
|
logger.info(consola_utils.colors.dim("=".repeat(40)));
|
|
1758
1758
|
logger.info(`欢迎使用 ${consola_utils.colors.bold(consola_utils.colors.cyan("mioki"))} 💓 ${consola_utils.colors.bold(consola_utils.colors.green(`v${version}`))}`);
|
|
1759
|
-
logger.info(consola_utils.colors.yellow(consola_utils.colors.underline(`一个基于 NapCat
|
|
1759
|
+
logger.info(consola_utils.colors.yellow(consola_utils.colors.underline(`一个基于 NapCat 的插件式 QQ 机器人框架`)));
|
|
1760
1760
|
logger.info(consola_utils.colors.cyan(`轻量 * 跨平台 * 插件式 * 热重载 * 注重开发体验`));
|
|
1761
1761
|
logger.info(consola_utils.colors.dim("=".repeat(40)));
|
|
1762
1762
|
logger.info(consola_utils.colors.dim(consola_utils.colors.italic(`作者: Viki <hi@viki.moe> (https://github.com/vikiboss)`)));
|
|
@@ -1787,21 +1787,25 @@ async function start(options = {}) {
|
|
|
1787
1787
|
process.on("uncaughtException", async (err) => {
|
|
1788
1788
|
const msg = stringifyError(err);
|
|
1789
1789
|
napcat.logger.error(`uncaughtException, 出错了: ${msg}`);
|
|
1790
|
-
if (
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
napcat.
|
|
1794
|
-
|
|
1790
|
+
if (botConfig.error_push) {
|
|
1791
|
+
if (Date.now() - lastNoticeTime < 1e3) return;
|
|
1792
|
+
lastNoticeTime = Date.now();
|
|
1793
|
+
await noticeMainOwner(napcat, `mioki 发生未捕获异常:\n\n${msg}`).catch(() => {
|
|
1794
|
+
napcat.logger.error("发送未捕获异常通知失败");
|
|
1795
|
+
});
|
|
1796
|
+
}
|
|
1795
1797
|
});
|
|
1796
1798
|
process.on("unhandledRejection", async (err) => {
|
|
1797
1799
|
const msg = stringifyError(err);
|
|
1798
1800
|
napcat.logger.error(`unhandledRejection, 出错了: ${msg}`);
|
|
1799
|
-
if (
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
napcat.
|
|
1804
|
-
|
|
1801
|
+
if (botConfig.error_push) {
|
|
1802
|
+
if (Date.now() - lastNoticeTime < 1e3) return;
|
|
1803
|
+
lastNoticeTime = Date.now();
|
|
1804
|
+
const date = (/* @__PURE__ */ new Date()).toLocaleString();
|
|
1805
|
+
await noticeMainOwner(napcat, `【${date}】\n\nmioki 发生未处理异常:\n\n${msg}`).catch(() => {
|
|
1806
|
+
napcat.logger.error("发送未处理异常通知失败");
|
|
1807
|
+
});
|
|
1808
|
+
}
|
|
1805
1809
|
});
|
|
1806
1810
|
ensurePluginDir();
|
|
1807
1811
|
const plugins = botConfig.plugins.map((p) => ({
|