82 lines
1.9 KiB
Batchfile
82 lines
1.9 KiB
Batchfile
@echo off
|
||
REM OC Bot - Installation Script (Windows)
|
||
REM Usage: install.bat
|
||
REM Coded by Ball Studios 🎨
|
||
|
||
setlocal enabledelayedexpansion
|
||
|
||
echo =========================================
|
||
echo OC Bot - Installation Script
|
||
echo Coded by Ball Studios <20>x1f3a8
|
||
echo =========================================
|
||
echo.
|
||
|
||
REM Check if Python is installed
|
||
python3 --version >nul 2>&1
|
||
if errorlevel 1 (
|
||
echo ❌ Python 3 is not installed!
|
||
echo Please install Python 3.11+ from https://www.python.org
|
||
pause
|
||
exit /b 1
|
||
)
|
||
|
||
for /f "tokens=2" %%i in ('python3 --version 2^>^&1') do set PYTHON_VERSION=%%i
|
||
echo ✅ Python !PYTHON_VERSION! found
|
||
echo.
|
||
|
||
REM Create virtual environment if it doesn't exist
|
||
if not exist "venv" (
|
||
echo 📦 Creating virtual environment...
|
||
python3 -m venv venv
|
||
echo ✅ Virtual environment created
|
||
) else (
|
||
echo ✅ Virtual environment already exists
|
||
)
|
||
|
||
echo.
|
||
|
||
REM Activate virtual environment
|
||
echo 🔧 Activating virtual environment...
|
||
call venv\Scripts\activate.bat
|
||
echo ✅ Virtual environment activated
|
||
echo.
|
||
|
||
REM Upgrade pip
|
||
echo 📦 Upgrading pip...
|
||
python -m pip install --upgrade pip >nul 2>&1
|
||
echo ✅ Pip upgraded
|
||
echo.
|
||
|
||
REM Install requirements
|
||
echo 📦 Installing dependencies...
|
||
pip install -r requirements.txt
|
||
echo ✅ Dependencies installed
|
||
echo.
|
||
|
||
REM Setup .env file
|
||
if not exist ".env" (
|
||
echo 📝 Creating .env file...
|
||
copy .env.example .env
|
||
echo ⚠️ .env file created. Please edit it with your settings:
|
||
echo - DISCORD_TOKEN
|
||
echo - DB_HOST
|
||
echo - DB_USER
|
||
echo - DB_PASSWORD
|
||
echo - DB_NAME
|
||
echo.
|
||
) else (
|
||
echo ✅ .env file already exists
|
||
)
|
||
|
||
echo.
|
||
echo =========================================
|
||
echo ✅ Installation Complete!
|
||
echo =========================================
|
||
echo.
|
||
echo 📝 Next steps:
|
||
echo 1. Edit .env with your Discord token and database credentials
|
||
echo 2. Create the database using MariaDB client
|
||
echo 3. Run the bot: python bot.py
|
||
echo.
|
||
pause
|