mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-25 16:43:55 +08:00
update:优化“更新唤醒词回复配置”中的过滤表情字符
This commit is contained in:
@@ -109,8 +109,8 @@ class WakeupWordsConfig:
|
|||||||
def update_wakeup_response(self, voice: str, file_path: str, text: str):
|
def update_wakeup_response(self, voice: str, file_path: str, text: str):
|
||||||
"""更新唤醒词回复配置"""
|
"""更新唤醒词回复配置"""
|
||||||
try:
|
try:
|
||||||
# 过滤表情字符
|
# 过滤表情符号
|
||||||
filtered_text = re.sub(r'[\U0001F600-\U0001F64F]', '', text)
|
filtered_text = re.sub(r'[\U0001F600-\U0001F64F\U0001F900-\U0001F9FF]', '', text)
|
||||||
|
|
||||||
config = self._load_config()
|
config = self._load_config()
|
||||||
voice_hash = hashlib.md5(voice.encode()).hexdigest()
|
voice_hash = hashlib.md5(voice.encode()).hexdigest()
|
||||||
|
|||||||
Reference in New Issue
Block a user