2024-07-27 10:12:45 +08:00
|
|
|
import asyncio
|
2024-07-24 02:36:46 +08:00
|
|
|
import multiprocessing
|
2024-07-24 02:57:35 +08:00
|
|
|
import time
|
2024-07-24 02:36:46 +08:00
|
|
|
|
|
|
|
from liteyuki.plugin import PluginMetadata
|
2024-07-27 10:12:45 +08:00
|
|
|
from liteyuki import get_bot, chan
|
2024-07-24 02:36:46 +08:00
|
|
|
|
|
|
|
__plugin_metadata__ = PluginMetadata(
|
|
|
|
name="plugin_loader",
|
|
|
|
description="轻雪插件加载器",
|
|
|
|
usage="",
|
2024-07-26 14:35:47 +08:00
|
|
|
type="liteyuki-main",
|
2024-07-24 02:36:46 +08:00
|
|
|
homepage=""
|
|
|
|
)
|
|
|
|
|
2024-07-24 02:57:35 +08:00
|
|
|
from src.utils import TempConfig, common_db
|
2024-07-27 10:12:45 +08:00
|
|
|
|
2024-07-24 02:36:46 +08:00
|
|
|
liteyuki = get_bot()
|
|
|
|
|
|
|
|
|
|
|
|
@liteyuki.on_after_start
|
|
|
|
def _():
|
2024-07-24 02:57:35 +08:00
|
|
|
temp_data = common_db.where_one(TempConfig(), default=TempConfig())
|
2024-07-24 02:58:16 +08:00
|
|
|
# 储存重启计时信息
|
2024-07-24 02:57:35 +08:00
|
|
|
if temp_data.data.get("reload", False):
|
|
|
|
delta_time = time.time() - temp_data.data.get("reload_time", 0)
|
|
|
|
temp_data.data["delta_time"] = delta_time
|
|
|
|
common_db.save(temp_data) # 更新数据
|
2024-07-24 02:36:46 +08:00
|
|
|
|
|
|
|
|
2024-07-31 02:28:25 +08:00
|
|
|
print("轻雪实例", liteyuki)
|
|
|
|
chan.send(liteyuki, "instance")
|
|
|
|
# @liteyuki.on_before_start
|
|
|
|
# def _():
|
|
|
|
# print("轻雪启动中")
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# @liteyuki.on_after_start
|
|
|
|
# async def _():
|
|
|
|
# print("轻雪启动完成")
|
|
|
|
# chan.send("轻雪启动完成")
|