mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-02 04:52:50 +08:00
feat: 启动时自动连接所有已保存的机器人实例
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
942a715542
commit
223ba45e65
1 file changed
+4
-5
+4
-5
@@ -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 },
|
||||||
|
|||||||
Reference in new issue
Block a user