测试auth动态化

This commit is contained in:
liuwei
2025-06-09 15:10:54 +08:00
parent 1fcabfd365
commit aaaf555156
10 changed files with 62 additions and 39 deletions

View File

@@ -57,6 +57,7 @@ class VideoPlugin(MessagePluginInterface):
def __init__(self):
super().__init__()
self.bot: WechatAPIClient = None
self.feature = self.register_feature()
# 使用Path对象处理路径自动适应不同操作系统
self.download_dir = str(Path(Path(__file__).parent, "down_load_dir"))
@@ -112,7 +113,7 @@ class VideoPlugin(MessagePluginInterface):
return command in self._commands
@plugin_stats_decorator(plugin_name="视频插件")
@plugin_points_cost(2, "视频插件消耗积分", Feature.VIDEO)
@plugin_points_cost(2, "视频插件消耗积分", FEATURE_KEY)
async def process_message(self, message: Dict[str, Any]) -> Tuple[bool, Optional[str]]:
"""处理消息"""
content = str(message.get("content", "")).strip()
@@ -123,7 +124,7 @@ class VideoPlugin(MessagePluginInterface):
self.bot: WechatAPIClient = message.get("bot")
# 检查权限
if roomid and gbm.get_group_permission(roomid, Feature.VIDEO) == PermissionStatus.DISABLED:
if roomid and gbm.get_group_permission(roomid, self.feature) == PermissionStatus.DISABLED:
return False, "没有权限"
try: