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.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.4";
|
|
890
890
|
|
|
891
891
|
//#endregion
|
|
892
892
|
//#region src/actions.ts
|
|
@@ -1705,7 +1705,7 @@ async function start(options = {}) {
|
|
|
1705
1705
|
const plugin_dir = getAbsPluginDir();
|
|
1706
1706
|
logger.info(colors$1.dim("=".repeat(40)));
|
|
1707
1707
|
logger.info(`欢迎使用 ${colors$1.bold(colors$1.cyan("mioki"))} 💓 ${colors$1.bold(colors$1.green(`v${version}`))}`);
|
|
1708
|
-
logger.info(colors$1.yellow(colors$1.underline(`一个基于 NapCat
|
|
1708
|
+
logger.info(colors$1.yellow(colors$1.underline(`一个基于 NapCat 的插件式 QQ 机器人框架`)));
|
|
1709
1709
|
logger.info(colors$1.cyan(`轻量 * 跨平台 * 插件式 * 热重载 * 注重开发体验`));
|
|
1710
1710
|
logger.info(colors$1.dim("=".repeat(40)));
|
|
1711
1711
|
logger.info(colors$1.dim(colors$1.italic(`作者: Viki <hi@viki.moe> (https://github.com/vikiboss)`)));
|
|
@@ -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) => ({
|