's'
This commit is contained in:
@@ -154,11 +154,10 @@ def shared_build_h5_keyword_message(query: str, user_id: str, profile_key: str)
|
||||
"""关键词命中时返回文档约定的 H5 msg(再经 _normalize 输出)。
|
||||
|
||||
命中规则:对用户 Query 首尾 trim 后,**包含**配置词作为连续子串即命中(子串匹配),
|
||||
不要求用户整句与关键词全等。异度(/hackrobot) 群卡片仅认「群」;Eric(/chatbot) 另认「加群」。
|
||||
不要求用户整句与关键词全等。群卡片统一按「群」子串命中。
|
||||
"""
|
||||
q = (query or "").strip()
|
||||
uid = (user_id or "").strip()
|
||||
prof = _resolve_profile_key(profile_key)
|
||||
if "电子书" in q:
|
||||
return {
|
||||
"news": {
|
||||
@@ -173,11 +172,7 @@ def shared_build_h5_keyword_message(query: str, user_id: str, profile_key: str)
|
||||
]
|
||||
}
|
||||
}
|
||||
if prof == HACKROBOT_PROFILE:
|
||||
# 「加群」含「群」子串,异度仅按「群」触发时需排除「加群」整词
|
||||
group_hit = ("群" in q) and ("加群" not in q)
|
||||
else:
|
||||
group_hit = ("群" in q) or ("加群" in q)
|
||||
group_hit = "群" in q
|
||||
if group_hit:
|
||||
return {
|
||||
"news": {
|
||||
|
||||
Reference in New Issue
Block a user