fix: improve name matching logic in _voice_reply_with_name function
deploy / deploy (push) Successful in 31s

This commit is contained in:
2026-08-29 01:32:08 +05:00
parent d2a9df36d1
commit 78007dae38
+2 -2
View File
@@ -611,10 +611,10 @@ def _voice_reply_with_name(language: str, reply_text: str, name: str | None) ->
normalized_short = _voice_text_key(short_name)
if reply_text.startswith(prefix):
rest = reply_text[len(prefix) :].lstrip()
if _voice_text_key(rest).startswith(normalized_short):
if normalized_short in _voice_text_key(rest).split(" "):
return reply_text
return f"{prefix}{short_name}, {rest}"
if _voice_text_key(reply_text).startswith(normalized_short):
if normalized_short in _voice_text_key(reply_text).split(" "):
return reply_text
return f"{short_name}, {reply_text}"