注册统计修复

This commit is contained in:
UnCLAS-Prommer
2025-06-15 02:50:27 +08:00
parent da2ca0f59f
commit 3ac8eaca9e
2 changed files with 10 additions and 1 deletions

View File

@@ -252,7 +252,16 @@ class ComponentRegistry:
def get_registry_stats(self) -> Dict[str, Any]:
"""获取注册中心统计信息"""
action_components: int = 0
command_components: int = 0
for component in self._components.values():
if component.component_type == ComponentType.ACTION:
action_components += 1
elif component.component_type == ComponentType.COMMAND:
command_components += 1
return {
"action_components": action_components,
"command_components": command_components,
"total_components": len(self._components),
"total_plugins": len(self._plugins),
"components_by_type": {

View File

@@ -136,7 +136,7 @@ class PluginManager:
if plugin_info:
# 插件基本信息
version_info = f"v{plugin_info.version}" if plugin_info.version else ""
author_info = f"by {plugin_info.author}" if plugin_info.author else ""
author_info = f"by {plugin_info.author}" if plugin_info.author else "unknown"
info_parts = [part for part in [version_info, author_info] if part]
extra_info = f" ({', '.join(info_parts)})" if info_parts else ""