1
0
forked from bot/app

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

This commit is contained in:
2024-07-26 14:35:47 +08:00
parent f22f4d229d
commit 13692228c6
6 changed files with 23 additions and 11 deletions

View File

@ -4,6 +4,7 @@ from typing import Any, Coroutine, Optional
import nonebot
import liteyuki
from liteyuki.plugin.load import load_plugin, load_plugins
from src.utils import (
adapter_manager,
@ -50,7 +51,6 @@ $$$$$$$$/ $$$$$$/ $$/ $$$$$$$$/ $$/ $$$$$$/ $$/ $$/ $$$$$$/
""" + "\033[0m")
def run(self, *args, **kwargs):
if _MAIN_PROCESS:
load_plugins("liteyuki/plugins")
asyncio.run(self.lifespan.before_start())
@ -177,9 +177,6 @@ $$$$$$$$/ $$$$$$/ $$/ $$$$$$$$/ $$/ $$$$$$/ $$/ $$/ $$$$$$/
def init_config(self):
pass
def register_adapters(self, *args):
pass
def on_before_start(self, func: LIFESPAN_FUNC):
"""
注册启动前的函数