chore: sync current WechatHookBot workspace
This commit is contained in:
@@ -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