🐛 [plugin]: 暂时关闭轻雪推送功能
This commit is contained in:
@ -28,16 +28,15 @@ def _():
|
||||
|
||||
|
||||
@bot.on_before_process_shutdown
|
||||
def _():
|
||||
def _(name="name"):
|
||||
logger.info("生命周期监控器:准备停止")
|
||||
|
||||
|
||||
@bot.on_before_process_restart
|
||||
def _():
|
||||
def _(name="name"):
|
||||
logger.info("生命周期监控器:准备重启")
|
||||
|
||||
|
||||
@bot.on_after_start
|
||||
async def _():
|
||||
await asyncio.sleep(6)
|
||||
logger.info("生命周期监控器:启动完成")
|
||||
|
@ -13,6 +13,7 @@ import nonebot
|
||||
from liteyuki.utils import IS_MAIN_PROCESS
|
||||
from liteyuki.plugin import PluginMetadata, PluginType
|
||||
from .nb_utils import adapter_manager, driver_manager # type: ignore
|
||||
from liteyuki.log import logger
|
||||
|
||||
__plugin_meta__ = PluginMetadata(
|
||||
name="NoneBot2启动器",
|
||||
@ -29,7 +30,6 @@ def nb_run(*args, **kwargs):
|
||||
Returns:
|
||||
"""
|
||||
# 给子进程传递通道对象
|
||||
|
||||
kwargs.update(kwargs.get("nonebot", {})) # nonebot配置优先
|
||||
nonebot.init(**kwargs)
|
||||
|
||||
@ -42,16 +42,12 @@ def nb_run(*args, **kwargs):
|
||||
nonebot.load_plugin("src.liteyuki_main") # 尝试加载轻雪主插件(Nonebot插件)
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
nonebot.run()
|
||||
|
||||
|
||||
if IS_MAIN_PROCESS:
|
||||
from liteyuki import get_bot
|
||||
from .dev_reloader import *
|
||||
|
||||
liteyuki = get_bot()
|
||||
|
||||
|
||||
@liteyuki.on_before_start
|
||||
async def start_run_nonebot():
|
||||
liteyuki.process_manager.add_target(name="nonebot", target=nb_run, args=(), kwargs=liteyuki.config)
|
||||
liteyuki.process_manager.add_target(name="nonebot", target=nb_run, args=(), kwargs=liteyuki.config)
|
||||
|
Reference in New Issue
Block a user