mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-03-03 17:05:04 +08:00
增加了配置项
本地跑没有问题,用户打开这个功能需要在config.json加入 "group_chat_exit_group": true, (但是不确定写的对不对,刚开始学cs哈哈,之前没搞过这个)
This commit is contained in:
@@ -49,12 +49,15 @@ class Hello(Plugin):
|
||||
return
|
||||
|
||||
if e_context["context"].type == ContextType.EXIT_GROUP:
|
||||
e_context["context"].type = ContextType.TEXT
|
||||
msg: ChatMessage = e_context["context"]["msg"]
|
||||
e_context["context"].content = f'请你随机使用一种风格跟其他群用户说他违反规则"{msg.actual_user_nickname}"退出群聊。'
|
||||
e_context.action = EventAction.BREAK # 事件结束,进入默认处理逻辑
|
||||
if conf().get("group_chat_exit_group", []) == True:
|
||||
e_context["context"].type = ContextType.TEXT
|
||||
msg: ChatMessage = e_context["context"]["msg"]
|
||||
e_context["context"].content = f'请你随机使用一种风格跟其他群用户说他违反规则"{msg.actual_user_nickname}"退出群聊。'
|
||||
e_context.action = EventAction.BREAK # 事件结束,进入默认处理逻辑
|
||||
return
|
||||
e_context.action = EventAction.BREAK
|
||||
return
|
||||
|
||||
|
||||
if e_context["context"].type == ContextType.PATPAT:
|
||||
e_context["context"].type = ContextType.TEXT
|
||||
msg: ChatMessage = e_context["context"]["msg"]
|
||||
|
||||
Reference in New Issue
Block a user