58 lines
1.6 KiB
Batchfile
58 lines
1.6 KiB
Batchfile
@echo off
|
|
chcp 65001 >nul 2>&1
|
|
title Gravity Bridge Bot
|
|
|
|
echo ╔══════════════════════════════════════╗
|
|
echo ║ Gravity Bridge Bot Launcher ║
|
|
echo ╚══════════════════════════════════════╝
|
|
echo.
|
|
|
|
REM — Find Python
|
|
set PYTHON=
|
|
where python >nul 2>&1 && set PYTHON=python
|
|
if "%PYTHON%"=="" (
|
|
if exist "C:\ProgramData\miniforge3\envs\gravity_control\python.exe" (
|
|
set PYTHON=C:\ProgramData\miniforge3\envs\gravity_control\python.exe
|
|
)
|
|
)
|
|
if "%PYTHON%"=="" (
|
|
echo [ERROR] Python not found. Install Python 3.10+ or set path.
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
REM — Check .env
|
|
if not exist "%~dp0.env" (
|
|
echo [SETUP] .env not found. Creating from .env.example...
|
|
if exist "%~dp0.env.example" (
|
|
copy "%~dp0.env.example" "%~dp0.env" >nul
|
|
echo [SETUP] .env created — edit it with your Discord token and Guild ID.
|
|
echo.
|
|
notepad "%~dp0.env"
|
|
echo Press any key after saving .env...
|
|
pause >nul
|
|
) else (
|
|
echo [ERROR] .env.example not found.
|
|
pause
|
|
exit /b 1
|
|
)
|
|
)
|
|
|
|
REM — Install dependencies (first run)
|
|
if not exist "%~dp0.deps_installed" (
|
|
echo [SETUP] Installing dependencies...
|
|
%PYTHON% -m pip install -r "%~dp0requirements.txt" -q
|
|
echo. > "%~dp0.deps_installed"
|
|
echo [SETUP] Dependencies installed.
|
|
)
|
|
|
|
echo [START] Starting bot with %PYTHON%...
|
|
echo [START] Press Ctrl+C to stop.
|
|
echo.
|
|
|
|
%PYTHON% "%~dp0main.py"
|
|
|
|
echo.
|
|
echo [STOP] Bot stopped.
|
|
pause
|