From cf1663af13310f993ee835d857bf78cbbc3b7a05 Mon Sep 17 00:00:00 2001 From: alan Date: Sat, 7 Feb 2026 22:18:43 +0800 Subject: [PATCH] feat: conditionally set telegram proxy --- nanobot/channels/telegram.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/nanobot/channels/telegram.py b/nanobot/channels/telegram.py index b62c63b..f2b6d1f 100644 --- a/nanobot/channels/telegram.py +++ b/nanobot/channels/telegram.py @@ -101,13 +101,10 @@ class TelegramChannel(BaseChannel): self._running = True # Build the application - self._app = ( - Application.builder() - .token(self.config.token) - .proxy(self.config.proxy) - .get_updates_proxy(self.config.proxy) - .build() - ) + builder = Application.builder().token(self.config.token) + if self.config.proxy: + builder = builder.proxy(self.config.proxy).get_updates_proxy(self.config.proxy) + self._app = builder.build() # Add message handler for text, photos, voice, documents self._app.add_handler(