mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-08-02 11:40:04 +00:00
✨ 添加内置工具插件,支持获取已加载插件列表和读取本地文件内容功能
This commit is contained in:
18
nonebot_plugin_marshoai/plugins/builtin_tools/manager.py
Normal file
18
nonebot_plugin_marshoai/plugins/builtin_tools/manager.py
Normal file
@ -0,0 +1,18 @@
|
||||
from nonebot_plugin_marshoai.plugin import get_plugins, on_function_call
|
||||
|
||||
|
||||
@on_function_call(description="获取已加载的插件列表")
|
||||
def get_marsho_plugins() -> str:
|
||||
"""获取已加载的插件列表
|
||||
|
||||
Returns:
|
||||
str: 插件列表
|
||||
"""
|
||||
|
||||
reply = "加载的插件列表"
|
||||
for p in get_plugins().values():
|
||||
if p.metadata:
|
||||
reply += f"名称: {p.metadata.name},描述: {p.metadata.description}\n"
|
||||
else:
|
||||
reply += f"名称: {p.name},描述: 暂无\n"
|
||||
return reply
|
Reference in New Issue
Block a user