Skip to content

Commit 60e0835

Browse files
committedNov 29, 2021
Don't require bot startup for bridge startup
The bridge can function just fine without it, we don't need to treat it as a fatal error.
1 parent 6702831 commit 60e0835

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎mautrix_telegram/__main__.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ def prepare_bridge(self) -> None:
100100
init_portal(self.context)
101101
self.add_startup_actions(init_puppet(self.context))
102102

103-
if self.bot:
104-
self.add_startup_actions(self.bot.start())
105103
if self.config["bridge.resend_bridge_info"]:
106104
self.add_startup_actions(self.resend_bridge_info())
107105

@@ -112,6 +110,12 @@ def prepare_bridge(self) -> None:
112110
async def start(self) -> None:
113111
await super().start()
114112

113+
if self.bot:
114+
try:
115+
await self.bot.start()
116+
except Exception as e:
117+
self.log.error(f"Failed to start bot: {e}")
118+
115119
semaphore = None
116120
concurrency = self.config['telegram.connection.concurrent_connections_startup']
117121
if concurrency:

0 commit comments

Comments
 (0)