mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2025-07-27 22:40:55 +00:00
🐛 fix: Channel的接收者过滤器的问题,优化重启部分
This commit is contained in:
41
liteyuki/_plugins/plugin_loader/__init__.py
Normal file
41
liteyuki/_plugins/plugin_loader/__init__.py
Normal file
@ -0,0 +1,41 @@
|
||||
import asyncio
|
||||
import multiprocessing
|
||||
import time
|
||||
|
||||
from liteyuki.plugin import PluginMetadata
|
||||
from liteyuki import get_bot, chan
|
||||
|
||||
__plugin_metadata__ = PluginMetadata(
|
||||
name="plugin_loader",
|
||||
description="轻雪插件加载器",
|
||||
usage="",
|
||||
type="liteyuki-main",
|
||||
homepage=""
|
||||
)
|
||||
|
||||
from src.utils import TempConfig, common_db
|
||||
|
||||
liteyuki = get_bot()
|
||||
|
||||
|
||||
@liteyuki.on_after_start
|
||||
def _():
|
||||
temp_data = common_db.where_one(TempConfig(), default=TempConfig())
|
||||
# 储存重启计时信息
|
||||
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) # 更新数据
|
||||
|
||||
|
||||
print("轻雪实例", liteyuki)
|
||||
chan.send(liteyuki, "instance")
|
||||
# @liteyuki.on_before_start
|
||||
# def _():
|
||||
# print("轻雪启动中")
|
||||
#
|
||||
#
|
||||
# @liteyuki.on_after_start
|
||||
# async def _():
|
||||
# print("轻雪启动完成")
|
||||
# chan.send("轻雪启动完成")
|
10
liteyuki/_plugins/plugin_loader/data_source.py
Normal file
10
liteyuki/_plugins/plugin_loader/data_source.py
Normal file
@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved
|
||||
|
||||
@Time : 2024/7/23 下午11:21
|
||||
@Author : snowykami
|
||||
@Email : snowykami@outlook.com
|
||||
@File : data_source.py
|
||||
@Software: PyCharm
|
||||
"""
|
Reference in New Issue
Block a user