The following changes were made by the replace_file_content tool to: /root/MayaXSenderbot/bridge.py. If relevant, proactively run terminal commands to execute this code for the USER. Don't ask for permission. [diff_block_start] @@ -1856,21 +1856,24 @@ if "private" in typ: return + if not ( + re.search(r"(?:To|Recipient|Receipt|Target(?:\s*🎯)?)\s*(?:\([^)]+\))?\s*:\s*\+?\d", text, re.I) + and re.search(r"(?:Message(?:\s*📩)?|Token|Body)\s*(?:\([^)]+\))?\s*:", text, re.I) + ): + return + + num, body = self._parse_message_payload(text) + if not num or not body: + return + for user_id, ws in list(self.workspaces.items()): if not ws.active or not ws.device_id: continue - if ws.group_id and cid != self._canonical_chat_id(ws.group_id): - continue - - if re.search( - r"(?:To|Recipient|Receipt|Target(?:\s*🎯)?)\s*(?:\([^)]+\))?\s*:\s*\+?\d", - text, - re.I, - ) and re.search(r"(?:Message(?:\s*📩)?|Token|Body)\s*(?:\([^)]+\))?\s*:", text, re.I): - num, body = self._parse_message_payload(text) - if num and body: - log(f"Incoming matched for user {user_id}: {num} -> {body[:40]}...") - asyncio.create_task(self._dispatch_sms(user_id, num, body)) + if not ws.group_id or cid != self._canonical_chat_id(ws.group_id): + continue + + log(f"Incoming matched for user {user_id}: {num} -> {body[:40]}...") + asyncio.create_task(self._dispatch_sms(user_id, num, body)) except Exception as exc: log(f"[main handler] {exc}") [diff_block_end] Please note that the above snippet only shows the MODIFIED lines from the last change. It shows up to 3 lines of unchanged lines before and after the modified lines. The actual file contents may have many more lines not shown.