chore: sync current WechatHookBot workspace
This commit is contained in:
22
plugins/GroupLeave/config.toml
Normal file
22
plugins/GroupLeave/config.toml
Normal file
@@ -0,0 +1,22 @@
|
||||
# 退群提醒插件配置
|
||||
|
||||
[plugin]
|
||||
enabled = true
|
||||
name = "GroupLeave"
|
||||
description = "成员退群时发送提醒卡片"
|
||||
|
||||
[leave]
|
||||
# 退群提醒卡片配置
|
||||
# 支持变量:{nickname} - 退群成员昵称
|
||||
title = "{nickname} 已退出群聊"
|
||||
desc = "{nickname} 离开了我们,祝TA一切顺利~"
|
||||
url = "https://www.functen.cn"
|
||||
# image_url 将使用退群成员的头像,无需配置
|
||||
|
||||
[behavior]
|
||||
# 是否启用退群提醒
|
||||
enabled = true
|
||||
# 启用提醒的群聊列表(为空则对所有群生效)
|
||||
enabled_groups = []
|
||||
# 禁用提醒的群聊列表
|
||||
disabled_groups = []
|
||||
@@ -11,35 +11,12 @@ import tomllib
|
||||
from pathlib import Path
|
||||
from loguru import logger
|
||||
from utils.plugin_base import PluginBase
|
||||
from utils.decorators import on_text_message
|
||||
|
||||
|
||||
# 定义事件装饰器
|
||||
def on_chatroom_member_remove(priority=50):
|
||||
"""群成员删除装饰器"""
|
||||
def decorator(func):
|
||||
setattr(func, '_event_type', 'chatroom_member_remove')
|
||||
setattr(func, '_priority', min(max(priority, 0), 99))
|
||||
return func
|
||||
return decorator
|
||||
|
||||
|
||||
def on_system_message(priority=50):
|
||||
"""系统消息装饰器"""
|
||||
def decorator(func):
|
||||
setattr(func, '_event_type', 'system_message')
|
||||
setattr(func, '_priority', min(max(priority, 0), 99))
|
||||
return func
|
||||
return decorator
|
||||
|
||||
|
||||
def on_chatroom_info_change(priority=50):
|
||||
"""群信息变化装饰器"""
|
||||
def decorator(func):
|
||||
setattr(func, '_event_type', 'chatroom_info_change')
|
||||
setattr(func, '_priority', min(max(priority, 0), 99))
|
||||
return func
|
||||
return decorator
|
||||
from utils.decorators import (
|
||||
on_text_message,
|
||||
on_system_message,
|
||||
on_chatroom_member_remove,
|
||||
on_chatroom_info_change
|
||||
)
|
||||
|
||||
|
||||
class GroupLeave(PluginBase):
|
||||
|
||||
Reference in New Issue
Block a user