diff options
Diffstat (limited to 'ATRI/plugins/manage/modules/shutdown.py')
-rw-r--r-- | ATRI/plugins/manage/modules/shutdown.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/ATRI/plugins/manage/modules/shutdown.py b/ATRI/plugins/manage/modules/shutdown.py index 11b2b1b..78f23e8 100644 --- a/ATRI/plugins/manage/modules/shutdown.py +++ b/ATRI/plugins/manage/modules/shutdown.py @@ -12,11 +12,8 @@ __doc__ = """ @ 关机 """ -shutdown = sv.on_command( - cmd="关机", - docs=__doc__, - permission=SUPERUSER -) +shutdown = sv.on_command(cmd="关机", docs=__doc__, permission=SUPERUSER) + @shutdown.handle() async def _shutdown(bot: Bot, event: MessageEvent, state: T_State) -> None: @@ -24,9 +21,10 @@ async def _shutdown(bot: Bot, event: MessageEvent, state: T_State) -> None: if msg: state["msg"] = msg + @shutdown.got("msg", prompt="[WARNING]此项操作将强行终止bot运行,是否继续(y/n)") async def __shutdown(bot: Bot, event: MessageEvent, state: T_State) -> None: - t = ['y', 'Y', '是'] + t = ["y", "Y", "是"] if state["msg"] in t: await bot.send(event, "咱还会醒来的,一定") exit(0) |