summaryrefslogtreecommitdiff
path: root/ATRI/plugins/manage/modules/shutdown.py
diff options
context:
space:
mode:
Diffstat (limited to 'ATRI/plugins/manage/modules/shutdown.py')
-rw-r--r--ATRI/plugins/manage/modules/shutdown.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/ATRI/plugins/manage/modules/shutdown.py b/ATRI/plugins/manage/modules/shutdown.py
deleted file mode 100644
index 78f23e8..0000000
--- a/ATRI/plugins/manage/modules/shutdown.py
+++ /dev/null
@@ -1,32 +0,0 @@
-from nonebot.typing import T_State
-from nonebot.permission import SUPERUSER
-from nonebot.adapters.cqhttp import Bot, MessageEvent
-
-from ATRI.service import Service as sv
-
-
-__doc__ = """
-紧急停机
-权限组:维护者
-用法:
- @ 关机
-"""
-
-shutdown = sv.on_command(cmd="关机", docs=__doc__, permission=SUPERUSER)
-
-
-async def _shutdown(bot: Bot, event: MessageEvent, state: T_State) -> None:
- msg = str(event.message).strip()
- if msg:
- state["msg"] = msg
-
-
[email protected]("msg", prompt="[WARNING]此项操作将强行终止bot运行,是否继续(y/n)")
-async def __shutdown(bot: Bot, event: MessageEvent, state: T_State) -> None:
- t = ["y", "Y", "是"]
- if state["msg"] in t:
- await bot.send(event, "咱还会醒来的,一定")
- exit(0)
- else:
- await shutdown.finish("再考虑下吧 ;w;")