Skip to content

Your lightweight open-source personal agent.

feat: conditionally set telegram proxy

alancf1663af1331
diff --git a/nanobot/channels/telegram.py b/nanobot/channels/telegram.py
index b62c63b83..f2b6d1f40 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(