From 3d6ff2b60ca6e1825fe7fd86e317144ad77ea2c2 Mon Sep 17 00:00:00 2001 From: Sanaei Date: Mon, 8 Jun 2026 22:37:37 +0200 Subject: [PATCH] fix(tgbot): apply bot settings on panel restart without full service restart The Telegram bot's config (enable flag, token, proxy, API server) was read only during a full server.Start(). The in-process "Restart Panel" path (StopPanelOnly/StartPanelOnly -> stop/start with the bot flag false) skipped the bot entirely, so enabling the bot or changing its proxy did not take effect until a full OS-level `systemctl restart x-ui`. Cycle the Telegram bot in the panel-only restart path while still leaving Xray and the traffic writer untouched (preserving the #4265 freeze fix), so "Restart Panel" reconciles the bot with the latest settings. Fixes #5033 --- web/web.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web/web.go b/web/web.go index e63dc0e4d..fa681eacf 100644 --- a/web/web.go +++ b/web/web.go @@ -358,9 +358,8 @@ func (s *Server) Start() (err error) { return s.start(true, true) } -// StartPanelOnly initializes the panel during an in-process panel restart without cycling Xray. func (s *Server) StartPanelOnly() (err error) { - return s.start(false, false) + return s.start(false, true) } func (s *Server) start(restartXray bool, startTgBot bool) (err error) { @@ -465,9 +464,8 @@ func (s *Server) Stop() error { return s.stop(true, true) } -// StopPanelOnly stops only panel-owned HTTP/background resources for an in-process panel restart. func (s *Server) StopPanelOnly() error { - return s.stop(false, false) + return s.stop(false, true) } func (s *Server) stop(stopXray bool, stopTgBot bool) error {