mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-02-06 16:12:14 +08:00
fix: generate break by bug
This commit is contained in:
@@ -31,8 +31,6 @@ class Hello(Plugin):
|
||||
ContextType.PATPAT,
|
||||
]:
|
||||
return
|
||||
if not self.config or not self.config.get("use_character_desc"):
|
||||
e_context["context"]["generate_breaked_by"] = EventAction.BREAK
|
||||
if e_context["context"].type == ContextType.JOIN_GROUP:
|
||||
if "group_welcome_msg" in conf():
|
||||
reply = Reply()
|
||||
@@ -40,6 +38,8 @@ class Hello(Plugin):
|
||||
reply.content = conf().get("group_welcome_msg", "")
|
||||
e_context["reply"] = reply
|
||||
e_context.action = EventAction.BREAK_PASS # 事件结束,并跳过处理context的默认逻辑
|
||||
if not self.config or not self.config.get("use_character_desc"):
|
||||
e_context["context"]["generate_breaked_by"] = EventAction.BREAK_PASS
|
||||
return
|
||||
e_context["context"].type = ContextType.TEXT
|
||||
msg: ChatMessage = e_context["context"]["msg"]
|
||||
@@ -52,6 +52,8 @@ class Hello(Plugin):
|
||||
msg: ChatMessage = e_context["context"]["msg"]
|
||||
e_context["context"].content = f"请你随机使用一种风格介绍你自己,并告诉用户输入#help可以查看帮助信息。"
|
||||
e_context.action = EventAction.BREAK # 事件结束,进入默认处理逻辑
|
||||
if not self.config or not self.config.get("use_character_desc"):
|
||||
e_context["context"]["generate_breaked_by"] = EventAction.BREAK
|
||||
return
|
||||
|
||||
content = e_context["context"].content
|
||||
|
||||
Reference in New Issue
Block a user