mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-21 14:17:11 +08:00
防止命中前缀导致死循环的情况
This commit is contained in:
@@ -99,12 +99,12 @@ class ChatChannel(Channel):
|
|||||||
match_prefix = check_prefix(content, conf().get("group_chat_prefix"))
|
match_prefix = check_prefix(content, conf().get("group_chat_prefix"))
|
||||||
match_contain = check_contain(content, conf().get("group_chat_keyword"))
|
match_contain = check_contain(content, conf().get("group_chat_keyword"))
|
||||||
flag = False
|
flag = False
|
||||||
|
if context["msg"].to_user_id != context["msg"].actual_user_id:
|
||||||
if match_prefix is not None or match_contain is not None:
|
if match_prefix is not None or match_contain is not None:
|
||||||
flag = True
|
flag = True
|
||||||
if match_prefix:
|
if match_prefix:
|
||||||
content = content.replace(match_prefix, "", 1).strip()
|
content = content.replace(match_prefix, "", 1).strip()
|
||||||
logger.info(f'context["msg"]: {context["msg"].__str__()}')
|
if context["msg"].is_at:
|
||||||
if context["msg"].is_at and context["msg"].to_user_id != context["msg"].actual_user_id:
|
|
||||||
logger.info("[WX]receive group at")
|
logger.info("[WX]receive group at")
|
||||||
if not conf().get("group_at_off", False):
|
if not conf().get("group_at_off", False):
|
||||||
flag = True
|
flag = True
|
||||||
|
|||||||
Reference in New Issue
Block a user