Files

74 lines
1.9 KiB
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@echo off
chcp 65001 >nul
echo ========================================
echo 首尔服务器 - 多平台机器人一键部署
echo ========================================
echo.
set DEPLOY_DIR=C:\bots
echo [1/5] 创建部署目录...
if not exist "%DEPLOY_DIR%" mkdir "%DEPLOY_DIR%"
if not exist "%DEPLOY_DIR%\telegram" mkdir "%DEPLOY_DIR%\telegram"
if not exist "%DEPLOY_DIR%\discord" mkdir "%DEPLOY_DIR%\discord"
echo ✅ 目录创建完成
echo.
echo [2/5] 检查Python环境...
python --version
if errorlevel 1 (
echo ❌ 未找到Python,请先安装Python 3.9+
pause
exit /b 1
)
echo ✅ Python环境正常
echo.
echo [3/5] 安装Telegram机器人依赖...
cd /d "%DEPLOY_DIR%\telegram\tg-search-bot"
pip install -r requirements.txt
if errorlevel 1 (
echo ⚠️ Telegram依赖安装失败,请手动检查
) else (
echo ✅ Telegram依赖安装完成
)
echo.
echo [4/5] 安装Discord机器人依赖...
cd /d "%DEPLOY_DIR%\discord\discord-bot"
pip install -r requirements.txt
if errorlevel 1 (
echo ⚠️ Discord依赖安装失败,请手动检查
) else (
echo ✅ Discord依赖安装完成
)
echo.
echo [5/5] 创建配置目录...
set CONFIG_DIR=%USERPROFILE%\.tg_search_bot
if not exist "%CONFIG_DIR%" mkdir "%CONFIG_DIR%"
echo ✅ 配置目录创建完成
echo.
echo ========================================
echo 部署完成!
echo ========================================
echo.
echo 下一步:
echo 1. 配置 Telegram Bot
echo 编辑 %CONFIG_DIR%\config.yaml
echo 填入 tg_chat_id 和 tg_bot_token
echo.
echo 2. 配置 Discord Bot
echo 编辑 %DEPLOY_DIR%\discord\discord-bot\.env
echo 填入 DISCORD_TOKEN
echo.
echo 3. 启动机器人:
echo 双击 %DEPLOY_DIR%\start_all.bat
echo.
echo 获取Token
echo - Telegram: 找 @BotFather 创建
echo - Discord: https://discord.com/developers/applications
echo.
pause