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] @@ -1019,25 +1019,30 @@ ws.temp_dev = text.strip() ws.state = "await_sim" self.save_workspace(ws) - await self.send(user_id, fmt_msg("Device Registered", f"šŸ“± **ID:** `{ws.temp_dev}`\nSelect SIM to use:\n0ļøāƒ£ — **SIM 1**\n1ļøāƒ£ — **SIM 2**", success=True)) + await self.send( + user_id, + fmt_msg("Device Registered", f"šŸ“± **ID:** `{ws.temp_dev}`\nSelect SIM to use below:\n0ļøāƒ£ — **SIM 1**\n1ļøāƒ£ — **SIM 2**", success=True), + keyboard=reply_kb(SIM_KB), + ) return True if ws.state == "await_sim": - if text not in ("0", "1"): - await self.send(user_id, fmt_msg("Invalid Choice", "Please select 0 or 1.", error=True)) - return True - - ws.sim = text - ws.device_id = ws.temp_dev.strip() - ws.active_mode = "fcm" - ws.active = True - ws.activation_ts = int(datetime.now(IST).timestamp() * 1000) - ws.last_processed_ts = ws.activation_ts - ws.state = None - self.save_workspace(ws) - await self.refresh_bridge_runtime(ws) - await self._auto_pin_status(ws) - await self.send(user_id, fmt_msg("FCM Activated", f"šŸš€ **System Live!**\nšŸ“± **Device:** `{ws.device_id}`\nšŸŽ“ **SIM Slot:** `{'SIM 1' if text == '0' else 'SIM 2'}`\nšŸ”„ **Mode:** `FCM`\n🟢 **Status:** Listening for FCM events...", success=True), keyboard=self._workspace_menu(ws)) + sim = parse_sim_choice(text) + if sim is None: + await self.send(user_id, fmt_msg("Invalid Choice", "Please select SIM 1 or SIM 2 using the buttons below.", error=True), keyboard=reply_kb(SIM_KB)) + return True + + ws.sim = sim + ws.device_id = ws.temp_dev.strip() + ws.active_mode = "fcm" + ws.active = True + ws.activation_ts = int(datetime.now(IST).timestamp() * 1000) + ws.last_processed_ts = ws.activation_ts + ws.state = None + self.save_workspace(ws) + await self.refresh_bridge_runtime(ws) + await self._auto_pin_status(ws) + await self.send(user_id, fmt_msg("FCM Activated", f"šŸš€ **System Live!**\nšŸ“± **Device:** `{ws.device_id}`\nšŸŽ“ **SIM Slot:** `{'SIM 1' if ws.sim == '0' else 'SIM 2'}`\nšŸ”„ **Mode:** `FCM`\n🟢 **Status:** Listening for FCM events...", success=True), keyboard=self._workspace_menu(ws)) return True if ws.state == "await_fb_dev": @@ -1046,15 +1046,20 @@ ws.temp_dev = text.strip() ws.state = "await_fb_sim" self.save_workspace(ws) - await self.send(user_id, fmt_msg("Device Registered", f"šŸ“± **ID:** `{ws.temp_dev}`\nSelect SIM to use:\n0ļøāƒ£ — **SIM 1**\n1ļøāƒ£ — **SIM 2**", success=True)) + await self.send( + user_id, + fmt_msg("Device Registered", f"šŸ“± **ID:** `{ws.temp_dev}`\nSelect SIM to use below:\n0ļøāƒ£ — **SIM 1**\n1ļøāƒ£ — **SIM 2**", success=True), + keyboard=reply_kb(SIM_KB), + ) return True if ws.state == "await_fb_sim": - if text not in ("0", "1"): - await self.send(user_id, fmt_msg("Invalid Choice", "Please select 0 or 1.", error=True)) - return True - - ws.sim = text + sim = parse_sim_choice(text) + if sim is None: + await self.send(user_id, fmt_msg("Invalid Choice", "Please select SIM 1 or SIM 2 using the buttons below.", error=True), keyboard=reply_kb(SIM_KB)) + return True + + ws.sim = sim ws.device_id = ws.temp_dev.strip() ws.active_mode = "firebase" ws.active = True [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.