临时调整权限模块,备份

This commit is contained in:
liuwei
2025-06-09 14:12:31 +08:00
parent cedab1cefd
commit 9d15bf965b
30 changed files with 882 additions and 138 deletions

View File

@@ -1,6 +1,7 @@
from typing import Dict, Any, Tuple, Optional, List
from base.plugin_common.plugin_interface import PluginInterface
from wechat_ipad import WechatAPIClient
from utils.robot_cmd.robot_command import Feature
class MessagePluginInterface(PluginInterface):
@@ -16,6 +17,26 @@ class MessagePluginInterface(PluginInterface):
"""支持的命令列表"""
return []
@property
def feature_key(self) -> Optional[str]:
"""插件对应的功能权限键名"""
return None
@property
def feature_description(self) -> Optional[str]:
"""插件对应的功能权限描述"""
return None
def register_feature(self) -> Optional[Feature]:
"""注册插件功能权限
Returns:
Feature: 注册的功能权限枚举如果不需要权限则返回None
"""
if self.feature_key and self.feature_description:
return Feature.register_feature(self.feature_key, self.feature_description)
return None
# 需要完成jobs 的业务所以完成bot注入
def set_bot(self, bot: WechatAPIClient) -> None:
self.bot: WechatAPIClient = bot