(self, target_id, target_name, duration_str, creds)
| 453 | await client.disconnect() |
| 454 | |
| 455 | async def start_monitor(self, target_id, target_name, duration_str, creds): |
| 456 | if not creds.get('tg_session'): |
| 457 | return {"status": "error", "error": "Non autenticato su Telegram"} |
| 458 | |
| 459 | duration_map = {"1 Ora": 3600, "6 Ore": 21600, "1 Giorno": 86400, "3 Giorni": 259200, "1 Settimana": 604800} |
| 460 | dur_sec = duration_map.get(duration_str, 3600) |
| 461 | |
| 462 | self.active_tasks[target_id] = True |
| 463 | telethon_loop.create_task(self._monitor_loop(target_id, target_name, dur_sec, creds)) |
| 464 | return {"status": "ok"} |
| 465 | |
| 466 | tg_monitor = TelegramMonitor() |
| 467 |
no test coverage detected