Command exited with code 0. Command output: 305- self.admin_ids = {str(x).strip() for x in raw_admins if str(x).strip()} 306- elif isinstance(raw_admins, str): 307- self.admin_ids = {x.strip() for x in raw_admins.split(",") if x.strip()} 308- else: 309- self.admin_ids = set() 310- if self.legacy_owner_id: 311- self.admin_ids.add(self.legacy_owner_id) 312- self.owner_phone = str(self.cfg.get("phone", "")).strip() 313- self.logs_group_id = str(self.cfg.get("logs_group_id", "")).strip() 314- 315: self.bot = Client( 316- "sam_bridge_bot", 317- api_id=self.api_id, 318- api_hash=self.api_hash, 319- bot_token=self.bot_token, 320- in_memory=True, 321- sleep_threshold=10, 322- ) 323- 324- self.http: Optional[aiohttp.ClientSession] = None 325- self.workspaces: dict[str, Workspace] = {} -- 487- return 488- self._bot_restarting = True 489- try: 490- log("[bot recovery] Bot client reconnect/restart triggered...") 491- if self.bot: 492- try: 493- await self.bot.stop() 494- except Exception: 495- pass 496- await asyncio.sleep(2) 497: self.bot = Client( 498- "sam_bridge_bot", 499- api_id=self.api_id, 500- api_hash=self.api_hash, 501- bot_token=self.bot_token, 502- in_memory=True, 503- sleep_threshold=10, 504- ) 505- self.bot.add_handler(MessageHandler(self._handle_bot_message)) 506- await self.bot.start() 507- log("[bot recovery] Bot client restarted and listening successfully!") -- 582- 583- async def _close_auth_client(self, user_id: str) -> None: 584- client = self.auth_clients.pop(user_id, None) 585- if client: 586- try: 587- await client.disconnect() 588- except Exception: 589- pass 590- 591- def _build_main_client(self) -> Client: 592: return Client( 593- str(LEGACY_SESSION_BASE), 594- api_id=self.api_id, 595- api_hash=self.api_hash, 596- phone_number=self.owner_phone or None, 597- sleep_threshold=10, 598- ) 599- 600- def _quarantine_main_session_files(self) -> None: 601- for suffix in (".session", ".session-journal", ".session-wal", ".session-shm"): 602- path = LEGACY_SESSION_BASE.with_suffix(suffix) -- 1082- return True 1083- 1084- if ws.state == "await_phone": 1085- phone = normalize_phone(text) 1086- if not re.match(r"^\+?\d{7,15}$", phone): 1087- await self.send(user_id, fmt_msg("Invalid Phone", "Please send again in international format.\nExample: `+919876543210`", error=True)) 1088- return True 1089- 1090- client = self.auth_clients.get(user_id) 1091- if client is None: 1092: client = Client(f"{ws.session_path}_auth", api_id=self.api_id, api_hash=self.api_hash) 1093- self.auth_clients[user_id] = client 1094- 1095- try: 1096- await client.connect() 1097- sent = await client.send_code(phone) 1098- except Exception as exc: 1099- await self.send(user_id, fmt_msg("Code Failed", f"Could not send OTP: `{exc}`", error=True), keyboard=reply_kb([["🔐 Connect Telegram"], ["🔙 Back to Menu"]])) 1100- return True 1101- 1102- ws.phone = phone