squidclaw 0.5.5 → 0.5.6
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/lib/channels/telegram/bot.js +6 -1
- package/lib/engine.js +8 -4
- package/package.json +1 -1
|
@@ -107,7 +107,12 @@ export class TelegramManager {
|
|
|
107
107
|
});
|
|
108
108
|
|
|
109
109
|
bot.catch((err) => {
|
|
110
|
-
|
|
110
|
+
if (err.message?.includes('terminated by other')) {
|
|
111
|
+
logger.warn('telegram', 'Another bot instance running — retrying in 5s...');
|
|
112
|
+
setTimeout(() => { try { bot.start(); } catch {} }, 5000);
|
|
113
|
+
} else {
|
|
114
|
+
logger.error('telegram', `Bot error for ${agentId}: ${err.message}`);
|
|
115
|
+
}
|
|
111
116
|
});
|
|
112
117
|
|
|
113
118
|
return botInfo;
|
package/lib/engine.js
CHANGED
|
@@ -105,10 +105,14 @@ export class SquidclawEngine {
|
|
|
105
105
|
};
|
|
106
106
|
|
|
107
107
|
// Start bot for all agents with telegram config
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
// Only start ONE bot instance (shared token = shared bot)
|
|
109
|
+
try {
|
|
110
|
+
const firstAgent = agents[0];
|
|
111
|
+
if (firstAgent) {
|
|
112
|
+
await this.telegramManager.startBot(firstAgent.id, this.config.channels.telegram.token);
|
|
113
|
+
}
|
|
114
|
+
} catch (err) {
|
|
115
|
+
console.log(' ✈️ Telegram: ' + err.message);
|
|
112
116
|
}
|
|
113
117
|
console.log(' ✈️ Telegram: connected');
|
|
114
118
|
} catch (err) {
|