diff --git a/src/bot/main.py b/src/bot/main.py index 27384f2..37fd61c 100644 --- a/src/bot/main.py +++ b/src/bot/main.py @@ -434,24 +434,23 @@ async def handle_voice(update: Update, context: ContextTypes.DEFAULT_TYPE): async def process_text_as_message(update: Update, context: ContextTypes.DEFAULT_TYPE, text: str): """Обработка распознанного текста как обычного сообщения""" chat_id = update.effective_chat.id - mode = chat_state.get_mode(chat_id) tool = get_selected_tool() model = get_selected_model() if tool == "opencode" else None - + # Проверяем не ждем ли мы email для XRay if chat_state.get_xray_state(chat_id) == XRayState.WAITING_EMAIL: email = text.strip() await process_xray_email(update, context, email) return - + thinking_msg = await update.message.reply_text("🤔 Думаю...") - + result, success = await orchestrator.ask(text, chat_id, tool, model, yolo=True) - + text_result = result.strip() if result else "" if not text_result: text_result = "⚠️ Пустой ответ от модели." - + text_result = text_result[:4096] await thinking_msg.edit_text(text_result, parse_mode="Markdown") @@ -459,7 +458,6 @@ async def process_text_as_message(update: Update, context: ContextTypes.DEFAULT_ async def handle_message(update: Update, context: ContextTypes.DEFAULT_TYPE): prompt = update.message.text chat_id = update.effective_chat.id - mode = chat_state.get_mode(chat_id) tool = get_selected_tool() model = get_selected_model() if tool == "opencode" else None