remottxrea
Advanced tools
+1
-1
| Metadata-Version: 2.4 | ||
| Name: remottxrea | ||
| Version: 1.0.91 | ||
| Version: 1.0.92 | ||
| Summary: Remote client framework for Telegram automation using Pyrogram | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/MohammadAhmadi-R/remottxrea |
+1
-1
@@ -7,3 +7,3 @@ [build-system] | ||
| name = "remottxrea" | ||
| version = "1.0.91" | ||
| version = "1.0.92" | ||
| description = "Remote client framework for Telegram automation using Pyrogram" | ||
@@ -10,0 +10,0 @@ readme = "README.md" |
| Metadata-Version: 2.4 | ||
| Name: remottxrea | ||
| Version: 1.0.91 | ||
| Version: 1.0.92 | ||
| Summary: Remote client framework for Telegram automation using Pyrogram | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/MohammadAhmadi-R/remottxrea |
+1
-1
@@ -8,3 +8,3 @@ from setuptools import setup, find_packages | ||
| name="remottxrea", | ||
| version="1.0.91", | ||
| version="1.0.92", | ||
| author="MrAhmadiRad", | ||
@@ -11,0 +11,0 @@ author_email="mohammadahmadirad69@gmail.com", |
@@ -29,6 +29,15 @@ # remottxrea/bot/command_router.py | ||
| print("COMMAND TEXT:", message.text) | ||
| print("RESOLVED HANDLER:", handler) | ||
| if not handler: | ||
| return | ||
| # ---- dispatch ---- | ||
| await handler.handle(message) | ||
| await handler.handle(message) | ||
| # handler = self.registry.resolve(message) | ||
| # if not handler: | ||
| # return | ||
| # # ---- dispatch ---- | ||
| # await handler.handle(message) |
| """ | ||
| Advanced Add Account Handler | ||
| Features: | ||
| - cancel command | ||
| - live countdown (edit every 1 sec) | ||
| - cooldown enforcement | ||
| - human-like delayed login | ||
| - fully compatible with SessionCreator | ||
| Clean state machine version | ||
| """ | ||
@@ -34,44 +28,51 @@ | ||
| # ============================================= | ||
| # CANCEL | ||
| # ============================================= | ||
| if text.lower() == "cancel": | ||
| if not text: | ||
| return | ||
| state = self.states.get(user_id) | ||
| text_lower = text.lower() | ||
| if state: | ||
| phone = state.get("phone") | ||
| # ================================================== | ||
| # START COMMAND | ||
| # ================================================== | ||
| if text_lower in ["/addaccount", "addaccount"]: | ||
| if phone in self.creator.pending: | ||
| try: | ||
| app = self.creator.pending[phone]["app"] | ||
| await app.disconnect() | ||
| except: | ||
| pass | ||
| self.states[user_id] = { | ||
| "step": "phone", | ||
| "unlock_time": 0, | ||
| } | ||
| del self.creator.pending[phone] | ||
| return await message.reply_text( | ||
| "📱 Send phone number with country code\n" | ||
| "Example:\n+491234567890\n\n" | ||
| "Type /cancel to abort." | ||
| ) | ||
| del self.states[user_id] | ||
| # ================================================== | ||
| # CANCEL | ||
| # ================================================== | ||
| if text_lower in ["cancel", "/cancel"]: | ||
| return await message.reply_text( | ||
| "❌ Add account cancelled" | ||
| ) | ||
| state = self.states.get(user_id) | ||
| return | ||
| if not state: | ||
| return await message.reply_text("No active process.") | ||
| # ============================================= | ||
| # START | ||
| # ============================================= | ||
| if text == "phone": | ||
| phone = state.get("phone") | ||
| self.states[user_id] = { | ||
| "step": "phone", | ||
| "unlock_time": 0 | ||
| } | ||
| if phone and phone in self.creator.pending: | ||
| try: | ||
| app = self.creator.pending[phone]["app"] | ||
| await app.disconnect() | ||
| except Exception: | ||
| pass | ||
| return await message.reply_text( | ||
| "Send phone number with country code\n" | ||
| "Example:\n+491234567890" | ||
| ) | ||
| del self.creator.pending[phone] | ||
| del self.states[user_id] | ||
| return await message.reply_text("❌ Add account cancelled") | ||
| # ================================================== | ||
| # CHECK ACTIVE STATE | ||
| # ================================================== | ||
| if user_id not in self.states: | ||
@@ -83,5 +84,5 @@ return | ||
| # ============================================= | ||
| # BLOCK IF UNDER COOLDOWN | ||
| # ============================================= | ||
| # ================================================== | ||
| # COOLDOWN BLOCK | ||
| # ================================================== | ||
| if now < state.get("unlock_time", 0): | ||
@@ -93,8 +94,9 @@ remaining = int(state["unlock_time"] - now) | ||
| # ============================================= | ||
| # ================================================== | ||
| # STEP 1 → PHONE | ||
| # ============================================= | ||
| # ================================================== | ||
| if state["step"] == "phone": | ||
| phone = text | ||
| logger = get_action_logger( | ||
@@ -106,3 +108,2 @@ action="add_account", | ||
| try: | ||
| await self.creator.send_code(phone) | ||
@@ -118,3 +119,3 @@ | ||
| f"📩 Code sent to {phone}\n" | ||
| f"Wait {COOLDOWN_SECONDS}s before sending code", | ||
| f"Wait", | ||
| COOLDOWN_SECONDS | ||
@@ -135,5 +136,5 @@ ) | ||
| # ============================================= | ||
| # ================================================== | ||
| # STEP 2 → CODE | ||
| # ============================================= | ||
| # ================================================== | ||
| if state["step"] == "code": | ||
@@ -155,6 +156,12 @@ | ||
| result = await self.creator.login_with_code( | ||
| phone, | ||
| code | ||
| ) | ||
| try: | ||
| result = await self.creator.login_with_code( | ||
| phone, | ||
| code | ||
| ) | ||
| except Exception as e: | ||
| logger.exception(f"Login error → {e}") | ||
| return await message.reply_text( | ||
| "Login failed" | ||
| ) | ||
@@ -174,4 +181,3 @@ if result is True: | ||
| message, | ||
| "🔐 2FA detected\n" | ||
| "Wait before sending password", | ||
| "🔐 2FA detected\nWait", | ||
| COOLDOWN_SECONDS | ||
@@ -191,5 +197,5 @@ ) | ||
| # ============================================= | ||
| # ================================================== | ||
| # STEP 3 → PASSWORD | ||
| # ============================================= | ||
| # ================================================== | ||
| if state["step"] == "password": | ||
@@ -211,6 +217,12 @@ | ||
| success = await self.creator.login_with_password( | ||
| phone, | ||
| password | ||
| ) | ||
| try: | ||
| success = await self.creator.login_with_password( | ||
| phone, | ||
| password | ||
| ) | ||
| except Exception as e: | ||
| logger.exception(f"2FA error → {e}") | ||
| return await message.reply_text( | ||
| "Password verification failed" | ||
| ) | ||
@@ -232,8 +244,3 @@ if success: | ||
| # ================================================== | ||
| async def _countdown( | ||
| self, | ||
| message, | ||
| base_text, | ||
| seconds | ||
| ): | ||
| async def _countdown(self, message, base_text, seconds): | ||
@@ -245,5 +252,3 @@ countdown_msg = await message.reply_text( | ||
| for remaining in range(seconds - 1, -1, -1): | ||
| await asyncio.sleep(1) | ||
| try: | ||
@@ -253,3 +258,3 @@ await countdown_msg.edit_text( | ||
| ) | ||
| except: | ||
| except Exception: | ||
| pass |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
136578
0.62%3722
0.32%