-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·54 lines (43 loc) · 1.32 KB
/
start.sh
File metadata and controls
executable file
·54 lines (43 loc) · 1.32 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
#!/bin/bash
# WhatsApp Bot Startup Script
echo "🚀 Starting WhatsApp Bot with Groq AI..."
# Check if .env file exists
if [ ! -f .env ]; then
echo "⚠️ .env file not found!"
echo "Creating .env from .env.example..."
if [ -f .env.example ]; then
cp .env.example .env
echo "✅ .env file created. Please edit it and add your GROQ_API_KEY"
exit 1
else
echo "❌ .env.example not found!"
exit 1
fi
fi
# Check if GROQ_API_KEY is set
if ! grep -q "GROQ_API_KEY=.*[^your_groq_api_key_here]" .env; then
echo "⚠️ GROQ_API_KEY not configured in .env file"
echo "Please edit .env and add your Groq API key"
exit 1
fi
# Check if virtual environment exists
if [ ! -d "venv" ]; then
echo "📦 Creating virtual environment..."
python3 -m venv venv
fi
# Activate virtual environment
echo "🔧 Activating virtual environment..."
source venv/bin/activate
# Install/update dependencies
echo "📥 Installing dependencies..."
pip install -q -r requirements.txt
# Create necessary directories
mkdir -p logs sessions
# Start the bot
echo "✅ Starting bot server..."
echo "📍 Server will be available at http://localhost:5000"
echo "📡 Webhook endpoint: http://localhost:5000/webhook"
echo ""
echo "Press Ctrl+C to stop the server"
echo ""
python whatsapp_bot.py