-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_bot.bat
More file actions
58 lines (50 loc) · 1.33 KB
/
Copy pathrun_bot.bat
File metadata and controls
58 lines (50 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@echo off
REM Startup script for API Bot on Windows
echo ================================================
echo API Resource Availability Bot - Starting
echo ================================================
echo.
REM Check if virtual environment exists
if not exist "venv\" (
echo [ERROR] Virtual environment not found!
echo Please run: python -m venv venv
pause
exit /b 1
)
REM Activate virtual environment
echo [1/3] Activating virtual environment...
call venv\Scripts\activate.bat
if %errorlevel% neq 0 (
echo [ERROR] Failed to activate virtual environment
pause
exit /b 1
)
REM Check if .env exists
if not exist ".env" (
echo [WARNING] .env file not found!
echo Please copy .env.example to .env and configure your bot token
pause
exit /b 1
)
REM Check dependencies
echo [2/3] Checking dependencies...
python -c "import telegram" 2>nul
if %errorlevel% neq 0 (
echo [ERROR] Dependencies not installed!
echo Please run: pip install -r requirements.txt
pause
exit /b 1
)
REM Start the bot
echo [3/3] Starting bot...
echo.
echo Bot is running! Press Ctrl+C to stop.
echo ================================================
echo.
python bot.py
REM If bot exits
echo.
echo ================================================
echo Bot stopped
echo ================================================
pause