2021-11-23 21:44:59 +08:00
|
|
|
from utils.manager import plugins_manager
|
2022-02-19 18:20:19 +08:00
|
|
|
from nonebot.adapters.onebot.v11 import Bot
|
2021-11-23 21:44:59 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
async def check_plugin_status(bot: Bot):
|
|
|
|
|
"""
|
|
|
|
|
遍历查看插件加载情况
|
|
|
|
|
"""
|
2022-11-21 20:43:41 +08:00
|
|
|
msg = ""
|
2021-11-23 21:44:59 +08:00
|
|
|
for plugin in plugins_manager.keys():
|
|
|
|
|
data = plugins_manager.get(plugin)
|
2022-11-22 11:31:42 +08:00
|
|
|
if data.error:
|
2022-11-21 20:43:41 +08:00
|
|
|
msg += f'{plugin}:{data.plugin_name}\n'
|
|
|
|
|
if msg and bot.config.superusers:
|
|
|
|
|
msg = "以下插件加载失败..\n" + msg
|
2021-11-23 21:44:59 +08:00
|
|
|
await bot.send_private_msg(
|
2022-11-21 20:43:41 +08:00
|
|
|
user_id=int(list(bot.config.superusers)[0]), message=msg.strip()
|
2021-11-23 21:44:59 +08:00
|
|
|
)
|