adding features: 退群提醒

后面还打算想办法加用户自己退出的提醒,目前版本是可以在群主(且群主/管理员自己是bot)踢人时候发出提醒
This commit is contained in:
erayyym
2023-12-05 03:58:42 -05:00
parent f4f5be5b08
commit 36f9680eec
4 changed files with 22 additions and 4 deletions

View File

@@ -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