-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.bat
41 lines (33 loc) · 1.03 KB
/
run.bat
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
@echo off
set PROJECT_NAME=SolTelegramBot
echo 💻 Starting %PROJECT_NAME%...
:: Check if Node.js is installed
echo 📦 Checking Node.js installation...
where node >nul 2>nul
if %ERRORLEVEL% neq 0 (
echo ⚠️ Node.js is not installed. Please install it from https://nodejs.org/
pause
exit /b 1
)
:: Check for npm dependencies
echo 📦 Ensuring dependencies are installed...
npm install
:: Check if .env file exists
echo 🛠️ Checking for .env file...
if not exist .env (
echo BOT_TOKEN=your_telegram_bot_token > .env
echo MAINNET_RPC=https://api.mainnet-beta.solana.com >> .env
echo ✅ .env file created. Please update it with your bot token and optional RPC endpoint.
)
:: Launch the bot
echo 🚀 Launching the bot...
node bot.js
:: Pause to display errors, if any
if %ERRORLEVEL% neq 0 (
echo ⚠️ An error occurred while running the bot. Please check your configuration and try again.
pause
exit /b 1
)
:: End
echo ✅ Bot is running! Send a message to your bot in Telegram to activate it.
pause