1
0
forked from bot/app

🐛 fix: Channel的接收者过滤器的问题,优化重启部分

This commit is contained in:
2024-07-31 02:35:05 +08:00
parent ca34f9c2a1
commit 6ba983fae3
3 changed files with 15 additions and 17 deletions

View File

@ -3,7 +3,6 @@ import asyncio
from typing import Any, Optional
from multiprocessing import freeze_support
from liteyuki.bot.lifespan import (LIFESPAN_FUNC, Lifespan)
from liteyuki.comm.channel import Channel
from liteyuki.core import IS_MAIN_PROCESS
@ -32,7 +31,6 @@ class LiteyukiBot:
self.chan = Channel() # 进程通信通道
self.pm: Optional[ProcessManager] = None # 启动时实例化
print("\033[34m" + r"""
__ ______ ________ ________ __ __ __ __ __ __ ______
/ | / |/ |/ |/ \ / |/ | / |/ | / |/ |
@ -49,12 +47,12 @@ $$$$$$$$/ $$$$$$/ $$/ $$$$$$$$/ $$/ $$$$$$/ $$/ $$/ $$$$$$/
# load_plugins("liteyuki/plugins") # 加载轻雪插件
self.pm = ProcessManager(bot=self, chan=self.chan)
self.pm.add_target("melobot", mb_run, **self.config)
self.pm.start("melobot")
self.pm.add_target("nonebot", nb_run, **self.config)
self.pm.start("nonebot")
self.pm.add_target("melobot", mb_run, **self.config)
self.pm.start("melobot")
run_coroutine(self.lifespan.after_start()) # 启动前
def restart(self, name: Optional[str] = None):