feat: 启动时自动连接所有已保存的机器人实例

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
saopig1andClaude Opus 4.6 committed 2026-03-30 20:28:43 +08:00
1 parent 942a715542
commit 223ba45e65
1 file changed
+4 -5
+4 -5
View File
@@ -137,21 +137,20 @@ export class BotManager {
this.bots.set(saved.id, bot); this.bots.set(saved.id, bot);
if (saved.autoStart) { // Auto-connect all saved bots on startup
try { try {
await bot.connect(); await bot.connect();
this.logger.info( this.logger.info(
{ botId: saved.id, name: saved.name }, { botId: saved.id, name: saved.name },
"Auto-started bot" "Auto-connected saved bot"
); );
} catch (err) { } catch (err) {
this.logger.error( this.logger.error(
{ err, botId: saved.id }, { err, botId: saved.id, name: saved.name },
"Failed to auto-start bot" "Failed to auto-connect bot (will retry on manual start)"
); );
} }
} }
}
this.logger.info( this.logger.info(
{ count: savedInstances.length }, { count: savedInstances.length },