PagerMaid-Pyro/pagermaid/modules/reload.py
xtaodada a941308d17
Some checks failed
Docker Dev Build / docker build and publish (push) Failing after 13s
Docker Build / docker build and publish (push) Failing after 11s
🔖 Update to v1.5.0
这是一项破坏性变更,目录结构进行了重组,无核心功能变化
2024-09-28 22:01:40 +08:00

21 lines
618 B
Python

from pagermaid.common.reload import reload_all
from pagermaid.enums import Message
from pagermaid.listener import listener
from pagermaid.services import scheduler
from pagermaid.static import read_context
from pagermaid.utils import lang
@listener(
is_plugin=False, command="reload", need_admin=True, description=lang("reload_des")
)
async def reload_plugins(message: Message):
"""To reload plugins."""
await reload_all()
await message.edit(lang("reload_ok"))
@scheduler.scheduled_job("cron", hour="4", id="reload.clear_read_context")
async def clear_read_context_cron():
read_context.clear()