Skip to content

Commit dbefd47

Browse files
committed
feat(reload): 添加 restart 作为 exit 的别名
.restart 与 .exit 相同:process.exit(0),由 PM2 自动拉起。
1 parent b6e9f1e commit dbefd47

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎src/plugin/reload.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ const HELP_TEXT = `🔄 Reload - 插件重载与内存管理
378378
379379
🔧 核心命令:
380380
• <code>${mainPrefix}reload</code> - 重新加载所有插件
381-
• <code>${mainPrefix}exit</code> - 退出进程
381+
• <code>${mainPrefix}exit</code> / <code>${mainPrefix}restart</code> - 退出进程(PM2 会自动拉起)
382382
• <code>${mainPrefix}pmr</code> - PM2 进程重启
383383
• <code>${mainPrefix}health</code> - 查看内存使用情况
384384
@@ -484,6 +484,11 @@ class ReloadPlugin extends Plugin {
484484
await executeExit(msg);
485485
},
486486

487+
// Alias of exit — process.exit(0); PM2 restarts the bot
488+
restart: async (msg) => {
489+
await executeExit(msg);
490+
},
491+
487492
pmr: async (msg) => {
488493
await msg.delete();
489494
scheduleTrackedTimeout(async () => {

0 commit comments

Comments
 (0)