Fix: удалить вызов get_mode() после удаления ChatMode
- Исправлена ошибка в handle_message - Исправлена ошибка в process_text_as_message - Бот теперь работает с голосовыми сообщениями Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
parent
6b21889964
commit
490278f680
|
|
@ -434,7 +434,6 @@ async def handle_voice(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||||
async def process_text_as_message(update: Update, context: ContextTypes.DEFAULT_TYPE, text: str):
|
async def process_text_as_message(update: Update, context: ContextTypes.DEFAULT_TYPE, text: str):
|
||||||
"""Обработка распознанного текста как обычного сообщения"""
|
"""Обработка распознанного текста как обычного сообщения"""
|
||||||
chat_id = update.effective_chat.id
|
chat_id = update.effective_chat.id
|
||||||
mode = chat_state.get_mode(chat_id)
|
|
||||||
tool = get_selected_tool()
|
tool = get_selected_tool()
|
||||||
model = get_selected_model() if tool == "opencode" else None
|
model = get_selected_model() if tool == "opencode" else None
|
||||||
|
|
||||||
|
|
@ -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):
|
async def handle_message(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||||
prompt = update.message.text
|
prompt = update.message.text
|
||||||
chat_id = update.effective_chat.id
|
chat_id = update.effective_chat.id
|
||||||
mode = chat_state.get_mode(chat_id)
|
|
||||||
tool = get_selected_tool()
|
tool = get_selected_tool()
|
||||||
model = get_selected_model() if tool == "opencode" else None
|
model = get_selected_model() if tool == "opencode" else None
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue