新增点歌插件。
This commit is contained in:
@@ -3,7 +3,7 @@ import toml
|
||||
from abc import ABC, abstractmethod
|
||||
import logging
|
||||
from enum import Enum
|
||||
from typing import Dict, Any, List, Optional
|
||||
from typing import Dict, Any, List, Optional, Tuple
|
||||
|
||||
|
||||
class PluginStatus(Enum):
|
||||
@@ -167,4 +167,34 @@ class PluginInterface(ABC):
|
||||
Returns:
|
||||
清理是否成功
|
||||
"""
|
||||
return True
|
||||
return True
|
||||
|
||||
# ... 其他现有方法 ...
|
||||
|
||||
def can_process(self, data: Any) -> bool:
|
||||
"""检查插件是否可以处理给定的数据
|
||||
|
||||
这是一个通用方法,用于检查插件是否可以处理特定类型的数据。
|
||||
子类可以根据需要重写此方法。
|
||||
|
||||
Args:
|
||||
data: 要检查的数据
|
||||
|
||||
Returns:
|
||||
如果插件可以处理该数据,则返回True,否则返回False
|
||||
"""
|
||||
return False
|
||||
|
||||
def process_message(self, message: Dict[str, Any]) -> Tuple[bool, Optional[str]]:
|
||||
"""
|
||||
处理消息
|
||||
|
||||
Args:
|
||||
message: 消息字典,包含消息的各种属性,以及发送消息所需的对象
|
||||
- wcf: WcfAPI对象,可用于发送消息
|
||||
- message_util: 消息工具类,提供更高级的消息处理功能
|
||||
|
||||
Returns:
|
||||
(是否已处理, 处理结果)
|
||||
"""
|
||||
raise NotImplementedError("子类必须实现此方法")
|
||||
Reference in New Issue
Block a user