feat: conditionally set telegram proxy

This commit is contained in:
alan 2026-02-07 22:18:43 +08:00
parent 3166c15cff
commit cf1663af13

View File

@ -101,13 +101,10 @@ class TelegramChannel(BaseChannel):
self._running = True self._running = True
# Build the application # Build the application
self._app = ( builder = Application.builder().token(self.config.token)
Application.builder() if self.config.proxy:
.token(self.config.token) builder = builder.proxy(self.config.proxy).get_updates_proxy(self.config.proxy)
.proxy(self.config.proxy) self._app = builder.build()
.get_updates_proxy(self.config.proxy)
.build()
)
# Add message handler for text, photos, voice, documents # Add message handler for text, photos, voice, documents
self._app.add_handler( self._app.add_handler(