mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-11-29 10:52:54 +00:00
Introduces a `botCancel` context and a global `StopBot()` function to ensure the Telegram bot's Long Polling operation is safely terminated (via context cancellation) before the service restarts. This prevents the "Conflict: another update consumer is running" (409) error upon panel restart. Changes: - Added `botCancel context.CancelFunc` to manage context cancellation. - Implemented global `StopBot()` function. - Updated `Tgbot.Stop()` to call `StopBot()`. - Modified `Tgbot.OnReceive()` to use the new cancellable context for `UpdatesViaLongPolling`. |
||
|---|---|---|
| .. | ||
| assets | ||
| controller | ||
| entity | ||
| global | ||
| html | ||
| job | ||
| locale | ||
| middleware | ||
| network | ||
| service | ||
| session | ||
| translation | ||
| web.go | ||