feat: conditionally set telegram proxy
This commit is contained in:
parent
3166c15cff
commit
cf1663af13
@ -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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user