fix:修复禁言插件和豆包画图插件

This commit is contained in:
SengokuCola
2025-06-11 00:18:48 +08:00
parent 6455dab5b8
commit 22aae4d1cd
17 changed files with 271 additions and 685 deletions

View File

@@ -167,16 +167,26 @@ class BasePlugin(ABC):
return True
def get_config(self, key: str, default: Any = None) -> Any:
"""获取插件配置值
"""获取插件配置值,支持嵌套键访问
Args:
key: 配置键名
key: 配置键名,支持嵌套访问如 "section.subsection.key"
default: 默认值
Returns:
Any: 配置值或默认值
"""
return self.config.get(key, default)
# 支持嵌套键访问
keys = key.split('.')
current = self.config
for k in keys:
if isinstance(current, dict) and k in current:
current = current[k]
else:
return default
return current
def register_plugin(cls):