测试auth动态化
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user