mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-29 05:09:46 +01:00
style: revert textHandle.py
This commit is contained in:
parent
9128c4240f
commit
90ac306d04
1 changed files with 1 additions and 13 deletions
|
|
@ -37,17 +37,7 @@ async def handleTextMessage(conn, message):
|
||||||
conn.client_have_voice = False
|
conn.client_have_voice = False
|
||||||
conn.asr_audio.clear()
|
conn.asr_audio.clear()
|
||||||
if "text" in msg_json:
|
if "text" in msg_json:
|
||||||
text = msg_json["text"]
|
await startToChat(conn, msg_json["text"])
|
||||||
text_len, text_without_punctuation = remove_punctuation_and_length(text)
|
|
||||||
if await conn.music_handler.handle_music_command(conn, text_without_punctuation):
|
|
||||||
conn.asr_server_receive = True
|
|
||||||
conn.asr_audio.clear()
|
|
||||||
return
|
|
||||||
# if text_len <= conn.max_cmd_length and await handleCMDMessage(conn, text_without_punctuation):
|
|
||||||
# return
|
|
||||||
if text_len > 0:
|
|
||||||
await startToChat(conn, text)
|
|
||||||
#await startToChat(conn, msg_json["text"])
|
|
||||||
elif msg_json["type"] == "iot":
|
elif msg_json["type"] == "iot":
|
||||||
if "descriptors" in msg_json:
|
if "descriptors" in msg_json:
|
||||||
await handleIotDescriptors(conn, msg_json["descriptors"])
|
await handleIotDescriptors(conn, msg_json["descriptors"])
|
||||||
|
|
@ -55,5 +45,3 @@ async def handleTextMessage(conn, message):
|
||||||
await handleIotStatus(conn, msg_json["states"])
|
await handleIotStatus(conn, msg_json["states"])
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
await conn.websocket.send(message)
|
await conn.websocket.send(message)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue