mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
✨ 添加重启系统限制
This commit is contained in:
parent
82a3527e2e
commit
9935e981f0
@ -1,6 +1,7 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
import platform
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
@ -89,6 +90,8 @@ async def run_restart_command(bat_path: Path, port: int):
|
|||||||
description="重启",
|
description="重启",
|
||||||
)
|
)
|
||||||
async def _() -> Result:
|
async def _() -> Result:
|
||||||
|
if platform.system() != "Windows":
|
||||||
|
return Result.fail("自动重启仅支持Windows系统,请尝试手动重启")
|
||||||
flag_file = None
|
flag_file = None
|
||||||
for file in os.listdir(Path()):
|
for file in os.listdir(Path()):
|
||||||
if file.startswith(FILE_NAME):
|
if file.startswith(FILE_NAME):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user