1
0
forked from bot/app

添加进程及生命周期管理器,添加轻雪框架支持

This commit is contained in:
2024-07-24 02:36:46 +08:00
parent 6ef3b09ec9
commit c137f2f916
41 changed files with 988 additions and 206 deletions

View File

@ -6,10 +6,13 @@ from src.utils.base.data_manager import InstalledPlugin, plugin_db
from src.utils.base.resource import load_resources
from src.utils.message.tools import check_for_package
from liteyuki import get_bot
load_resources()
init_log()
driver = get_driver()
liteyuki_bot = get_bot()
@driver.on_startup
@ -29,3 +32,33 @@ async def load_plugins():
nonebot.plugin.load_plugins("plugins")
else:
nonebot.logger.info("Safe mode is on, no plugin loaded.")
@liteyuki_bot.on_before_start
async def _():
print("启动前")
@liteyuki_bot.on_after_start
async def _():
print("启动后")
@liteyuki_bot.on_before_shutdown
async def _():
print("停止前")
@liteyuki_bot.on_after_shutdown
async def _():
print("停止后")
@liteyuki_bot.on_before_restart
async def _():
print("重启前")
@liteyuki_bot.on_after_restart
async def _():
print("重启后")