chore: Organize workspace structure - move docs, workflows, scripts to subdirectories
Organization: - Created docs/ with setup/, guides/, history/ subdirectories - Created workflows/ with trading/, analytics/, telegram/, archive/ subdirectories - Created scripts/ with docker/, setup/, testing/ subdirectories - Created tests/ for TypeScript test files - Created archive/ for unused reference files Moved files: - 17 documentation files → docs/ - 16 workflow JSON files → workflows/ - 10 shell scripts → scripts/ - 4 test files → tests/ - 5 unused files → archive/ Updated: - README.md with new file structure and documentation paths Deleted: - data/ (empty directory) - screenshots/ (empty directory) Critical files remain in root: - telegram_command_bot.py (active bot - used by Dockerfile) - watch-restart.sh (systemd service dependency) - All Dockerfiles and docker-compose files - All environment files Validation: Containers running (trading-bot-v4, telegram-trade-bot, postgres) API responding (positions endpoint tested) Telegram bot functional (/status command tested) All critical files present in root No code changes - purely organizational. System continues running without interruption. Recovery: git revert HEAD or git reset --hard cleanup-before
This commit is contained in:
60
scripts/setup/setup_telegram_bot.sh
Executable file
60
scripts/setup/setup_telegram_bot.sh
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/bin/bash
|
||||
# Setup Telegram Trade Bot
|
||||
|
||||
echo "🤖 Telegram Trade Bot Setup"
|
||||
echo "============================"
|
||||
echo ""
|
||||
|
||||
# Check if .env.telegram-bot exists
|
||||
if [ ! -f .env.telegram-bot ]; then
|
||||
echo "❌ .env.telegram-bot not found!"
|
||||
echo "Create it with your bot token and webhook URL"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Source the env file
|
||||
source .env.telegram-bot
|
||||
|
||||
# Check required vars
|
||||
if [ "$TELEGRAM_BOT_TOKEN" = "your_bot_token_here" ]; then
|
||||
echo "❌ Please set TELEGRAM_BOT_TOKEN in .env.telegram-bot"
|
||||
echo ""
|
||||
echo "Steps:"
|
||||
echo "1. Message @BotFather on Telegram"
|
||||
echo "2. Send /newbot"
|
||||
echo "3. Follow instructions to get your bot token"
|
||||
echo "4. Put the token in .env.telegram-bot"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$N8N_WEBHOOK_URL" == *"your-n8n-url"* ]]; then
|
||||
echo "❌ Please set N8N_WEBHOOK_URL in .env.telegram-bot"
|
||||
echo ""
|
||||
echo "Steps:"
|
||||
echo "1. Import telegram-manual-trade-FINAL.json into n8n"
|
||||
echo "2. Activate the workflow"
|
||||
echo "3. Copy the webhook URL from the first node"
|
||||
echo "4. Put the URL in .env.telegram-bot"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Configuration looks good!"
|
||||
echo ""
|
||||
echo "📱 Chat ID: $TELEGRAM_CHAT_ID"
|
||||
echo "🔗 Webhook: $N8N_WEBHOOK_URL"
|
||||
echo ""
|
||||
echo "Building and starting bot..."
|
||||
echo ""
|
||||
|
||||
# Build and start
|
||||
docker-compose -f docker-compose.telegram-bot.yml --env-file .env.telegram-bot up -d --build
|
||||
|
||||
echo ""
|
||||
echo "✅ Bot started!"
|
||||
echo ""
|
||||
echo "Test it by sending to your Telegram chat:"
|
||||
echo " buy sol"
|
||||
echo " sell btc"
|
||||
echo " buy eth"
|
||||
echo ""
|
||||
echo "View logs: docker logs -f telegram-trade-bot"
|
||||
Reference in New Issue
Block a user