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] @@ -813,95 +813,6 @@ except Exception as exc: log(f"[fcm notify] send to logs group failed: {exc}") - def _sponsor_inline_kb(self) -> InlineKeyboardMarkup: - return InlineKeyboardMarkup([ - [InlineKeyboardButton("🤖 Open Sponsor Bot (@HinduTextBot)", url=f"https://t.me/{SPONSOR_BOT_USERNAME}")], - ]) - - def _sponsor_reply_kb(self) -> ReplyKeyboardMarkup: - return reply_kb([ - ["🔄 Verify Sponsor Status"], - ["/start"], - ]) - - async def _check_sponsor_status(self, ws: Workspace, force: bool = False) -> tuple[bool, str]: - now = int(time.time()) - # Check cache (24 hours TTL) - if not force and ws.sponsor_verified and (now - ws.last_sponsor_check_ts < SPONSOR_CHECK_TTL): - return True, "cached" - - user_id = ws.user_id - url = f"{SPONSOR_API_URL}?id={user_id}&key={SPONSOR_API_KEY}" - try: - if not self.http or self.http.closed: - self.http = aiohttp.ClientSession() - async with self.http.get(url, timeout=aiohttp.ClientTimeout(total=8)) as resp: - if resp.status == 200: - data = await resp.json(content_type=None) - has_started = bool(data.get("has_started", False)) - is_blocked = bool(data.get("is_blocked", False)) - if has_started and not is_blocked: - ws.sponsor_verified = True - ws.last_sponsor_check_ts = now - self.save_workspace(ws) - return True, "verified" - else: - ws.sponsor_verified = False - self.save_workspace(ws) - return False, "not_started" - else: - log(f"[sponsor check] HTTP {resp.status} for user {user_id}") - except Exception as exc: - log(f"[sponsor check] API error for user {user_id}: {exc}") - # If temporary network issue and user was previously verified within 48h, fallback gracefully - if ws.sponsor_verified and (now - ws.last_sponsor_check_ts < SPONSOR_CHECK_TTL * 2): - return True, "fallback" - - ws.sponsor_verified = False - self.save_workspace(ws) - return False, "unverified" - - async def _send_sponsor_gate(self, ws: Workspace, is_retry: bool = False) -> None: - user_id = ws.user_id - if is_retry: - body = ( - "⚠️ **Sponsor Verification Incomplete!**\n\n" - f"We could not confirm that you have started our official sponsor bot **@{SPONSOR_BOT_USERNAME}**.\n\n" - "📌 **To unlock access:**\n" - f"1️⃣ Tap **'Open Sponsor Bot'** below\n" - f"2️⃣ Press **START** (`/start`) in @{SPONSOR_BOT_USERNAME}\n" - "3️⃣ Tap **'🔄 Verify Sponsor Status'** below" - ) - title = "Verification Failed" - else: - body = ( - "📢 **OFFICIAL SPONSOR NOTICE** 🤝\n\n" - "To maintain high server speed and keep this service **100% free**, daily access is sponsored by **@HinduTextBot**.\n\n" - "🔒 **Daily Verification Required (Every 24 Hours):**\n" - f"1️⃣ Open sponsor bot 👉 **@{SPONSOR_BOT_USERNAME}**\n" - "2️⃣ Click **START** (`/start`) inside the sponsor bot\n" - "3️⃣ Come back and press **'🔄 Verify Sponsor Status'** to unlock your dashboard.\n\n" - "_⚡️ Takes only 5 seconds to complete!_" - ) - title = "Sponsor Verification" - - try: - target = int(user_id) if str(user_id).lstrip("-").isdigit() else user_id - await self.bot.send_message( - target, - fmt_msg(title, body, error=is_retry, success=False), - reply_markup=self._sponsor_inline_kb(), - ) - except Exception as exc: - log(f"[sponsor gate send] inline failed: {exc}") - await self.send(user_id, fmt_msg(title, body, error=is_retry, success=False)) - - await self.send( - user_id, - "👇 _Tap below after starting @HinduTextBot to verify:_", - keyboard=self._sponsor_reply_kb(), - ) - async def _handle_bot_message(self, client: Client, message) -> None: try: if not message or not message.text or not message.from_user: @@ -912,29 +912,6 @@ ws = self.load_workspace(user_id) text = message.text.strip() - # Handle verification button / check - if text in ("🔄 Verify Sponsor Status", "Verify Sponsor Status", "/verify"): - ok, _ = await self._check_sponsor_status(ws, force=True) - if ok: - await self.send( - user_id, - fmt_msg( - "Verified", - f"✅ **Sponsor verification successful!**\nThank you for supporting **@{SPONSOR_BOT_USERNAME}**.\n\nYour access is unlocked for the next 24 hours.", - success=True, - ), - ) - await self.send_menu(ws) - else: - await self._send_sponsor_gate(ws, is_retry=True) - return - - # Check sponsor status daily (24 hour verification gate) - is_verified, _ = await self._check_sponsor_status(ws, force=False) - if not is_verified: - await self._send_sponsor_gate(ws, is_retry=False) - return - if text in ("/start", "/menu", "🔙 Back to Menu"): ws.state = None self.save_workspace(ws) [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.