refactor: system类命令

This commit is contained in:
Rock Chin
2023-03-30 03:38:33 +00:00
parent 4055d3542b
commit 2069ba6836
7 changed files with 171 additions and 1 deletions
+23
View File
@@ -0,0 +1,23 @@
from ..mgr import AbstractCommandNode, Context
import threading
@AbstractCommandNode.register(
parent=None,
name="reload",
description="执行热重载",
usage="!reload",
aliases=[],
privilege=2
)
class ReloadCommand(AbstractCommandNode):
@classmethod
def process(cls, ctx: Context) -> tuple[bool, list]:
reply = []
import pkg.utils.reloader
def reload_task():
pkg.utils.reloader.reload_all()
threading.Thread(target=reload_task, daemon=True).start()
return True, reply