Command exited with code 0. Command output: f"⚠️ **Session Paused Automatically**\n\n" f"Your active session has been paused because another user is now actively monitoring the group `{target_group}`.\n\n" f"Only one user can actively monitor a group at a time." ) await self.send(other_uid, fmt_msg("Session Paused", body, error=True)) async def ensure_bridge_runtime(self, ws: Workspace) -> None: if not ws.active or not ws.device_id: return await self._deactivate_duplicate_groups(ws) user_id = ws.user_id if not self.main_client_ready: await self.send(ws.user_id, fmt_msg("Session Not Ready", "Main Telegram session is not ready yet. Please wait.", error=True), keyboard=self._workspace_menu(ws)) return task: Optional[asyncio.Task] = None if ws.active_mode in ("firebase", "fcm") and ws.forward_to: existing = self.bridge_tasks.get(user_id) if existing and not existing.done(): return task = asyncio.create_task(self._watch_firebase(user_id)) self.bridge_tasks[user_id] = task log(f"Bridge started for user {user_id} ({ws.active_mode}).") await self._auto_pin_status(ws) async def refresh_bridge_runtime(self, ws: Workspace) -> None: user_id = ws.user_id if not ws.active or not ws.device_id: await self.stop_bridge_runtime(user_id, keep_state=True) return await self._deactivate_duplicate_groups(ws) task = self.bridge_tasks.pop(user_id, None) if task: task.cancel() if ws.active_mode in ("firebase", "fcm") and ws.forward_to: self.bridge_tasks[user_id] = asyncio.create_task(self._watch_firebase(user_id)) async def stop_bridge_runtime(self, user_id: str, keep_state: bool = True) -> None: task = self.bridge_tasks.pop(user_id, None) if task: task.cancel() ws = self.load_workspace(user_id) if ws and ws.pinned_status_msg_id and self.bot: try: await self.bot.unpin_chat_message(int(user_id), ws.pinned_status_msg_id) log(f"[stop] unpinned msg {ws.pinned_status_msg_id} for {user_id}") except Exception as e: log(f"[stop] unpin by id failed: {e}") try: await self.bot.unpin_chat_message(int(user_id)) except Exception as e2: log(f"[stop] unpin latest also failed: {e2}") ws.pinned_status_msg_id = 0 self.save_workspace(ws) async def _auto_pin_status(self, ws: Workspace) -> None: if not self.bot: return info = [] info.append("🟢 **BRIDGE ACTIVE**" if ws.active else "🔴 **BRIDGE INACTIVE**") info.append(f"📱 **Mode:** {ws.active_mode.upper()}") if ws.active_mode == "firebase" and ws.firebase_auth: info.append(f"🔐 **Auth:** `Set`") if ws.device_id: info.append(f"📱 **Device:** `{ws.device_id}`") if ws.group_id: gname = next((n for n, i in ws.saved_groups.items() if str(i) == str(ws.group_id)), None) if gname: info.append(f"📡 **Group:** {gname} (`{ws.group_id}`)") else: info.append(f"📡 **Group:** `{ws.group_id}`") if ws.forward_to: info.append(f"📞 **Forward:** `{ws.forward_to}`") info.append(f"📊 **Sent:** {ws.sent}")