加入bot,自动注入内容,在项目启动完成之后,给每个插件注入bot
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from typing import Dict, Any, Tuple, Optional, List
|
||||
from plugin_common.plugin_interface import PluginInterface
|
||||
from wechat_ipad import WechatAPIClient
|
||||
|
||||
|
||||
class MessagePluginInterface(PluginInterface):
|
||||
@@ -15,6 +16,10 @@ class MessagePluginInterface(PluginInterface):
|
||||
"""支持的命令列表"""
|
||||
return []
|
||||
|
||||
# 需要完成jobs 的业务,所以完成bot注入
|
||||
def set_bot(self, bot: WechatAPIClient) -> None:
|
||||
self.bot: WechatAPIClient = bot
|
||||
|
||||
def can_process(self, message: Dict[str, Any]) -> bool:
|
||||
"""
|
||||
检查插件是否可以处理该消息
|
||||
|
||||
Reference in New Issue
Block a user