orchestrix-yuri 2.3.0 → 2.3.1
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.
|
@@ -82,12 +82,16 @@ class TelegramAdapter {
|
|
|
82
82
|
log.warn(`Bot error: ${msg}`);
|
|
83
83
|
});
|
|
84
84
|
|
|
85
|
-
//
|
|
85
|
+
// Force-disconnect any stale polling connection before starting.
|
|
86
|
+
// deleteWebhook clears webhooks but does NOT terminate existing
|
|
87
|
+
// long-polling getUpdates connections. A short getUpdates call
|
|
88
|
+
// with timeout=0 "steals" the connection, terminating the old one.
|
|
86
89
|
log.telegram('Connecting...');
|
|
87
90
|
try {
|
|
88
91
|
await this.bot.api.deleteWebhook({ drop_pending_updates: true });
|
|
92
|
+
await this.bot.api.raw.getUpdates({ offset: -1, limit: 1, timeout: 0 });
|
|
89
93
|
} catch {
|
|
90
|
-
// ignore —
|
|
94
|
+
// ignore — best effort cleanup
|
|
91
95
|
}
|
|
92
96
|
|
|
93
97
|
// Start polling
|