diff --git a/homelab-ai-bot/telegram_bot.py b/homelab-ai-bot/telegram_bot.py index bf684e60..81f9db08 100644 --- a/homelab-ai-bot/telegram_bot.py +++ b/homelab-ai-bot/telegram_bot.py @@ -433,6 +433,22 @@ async def handle_message(update: Update, ctx: ContextTypes.DEFAULT_TYPE): ) sent = True + elif suggest["type"] in ("active_temporary", "active_permanent", "active_other"): + from datetime import datetime as _dt + active_items = memory_client.get_active_memory() + matched = _find_matching_item(text, active_items) + if matched: + mtype = matched.get("memory_type", "") + exp = matched.get("expires_at") + if mtype == "temporary" and exp: + status_msg = f"\n\n🕒 Schon temporär gespeichert bis {_dt.fromtimestamp(exp).strftime('%d.%m.%Y')}." + elif mtype == "permanent": + status_msg = "\n\n📌 Schon dauerhaft gespeichert." + else: + status_msg = "\n\n✅ Bereits gespeichert." + await update.message.reply_text(answer[:3900] + status_msg, reply_markup=KEYBOARD) + sent = True + elif suggest["type"] == "new_candidate": candidates_after = memory_client.get_candidates() new_candidates = [c for c in candidates_after if c["id"] not in candidates_before]