mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-03-20 05:51:55 +08:00
adding features: 退群提醒
后面还打算想办法加用户自己退出的提醒,目前版本是可以在群主(且群主/管理员自己是bot)踢人时候发出提醒
This commit is contained in:
@@ -29,6 +29,7 @@ class Hello(Plugin):
|
||||
ContextType.TEXT,
|
||||
ContextType.JOIN_GROUP,
|
||||
ContextType.PATPAT,
|
||||
ContextType.EXIT_GROUP
|
||||
]:
|
||||
return
|
||||
if e_context["context"].type == ContextType.JOIN_GROUP:
|
||||
@@ -46,6 +47,13 @@ class Hello(Plugin):
|
||||
e_context["context"].content = f'请你随机使用一种风格说一句问候语来欢迎新用户"{msg.actual_user_nickname}"加入群聊。'
|
||||
e_context.action = EventAction.BREAK # 事件结束,进入默认处理逻辑
|
||||
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 # 事件结束,进入默认处理逻辑
|
||||
return
|
||||
|
||||
if e_context["context"].type == ContextType.PATPAT:
|
||||
e_context["context"].type = ContextType.TEXT
|
||||
|
||||
Reference in New Issue
Block a user