-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
59 lines (52 loc) · 1.88 KB
/
setup.sh
File metadata and controls
59 lines (52 loc) · 1.88 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
54
55
56
57
58
59
#!/bin/bash
# Setup script for UtilsBot+
echo "🤖 UtilsBot+ Setup Script"
echo "================================"
echo ""
# Check if .env file exists
if [ -f ".env" ]; then
echo "⚠️ .env file already exists. Creating backup..."
cp .env .env.backup.$(date +%s)
fi
# Copy example file
echo "📋 Creating .env file from template..."
cp .env.example .env
echo ""
echo "📝 Please configure the following REQUIRED environment variables in .env:"
echo ""
echo "1. BOT_TOKEN - Get from https://discord.com/developers/applications"
echo " - Create a new application"
echo " - Go to 'Bot' section"
echo " - Copy the token"
echo ""
echo "2. DEV_IDS - Your Discord User ID"
echo " - Enable Developer Mode in Discord settings"
echo " - Right-click your profile and 'Copy User ID'"
echo ""
echo "3. GEMINI_API_KEY - Get from https://aistudio.google.com/app/apikey"
echo " - Create a new API key (free tier available)"
echo ""
echo "4. SECRET_KEY - Generate a random string for encryption"
echo " - You can use: python3 -c 'import secrets; print(secrets.token_hex(32))'"
echo ""
# Generate a secret key suggestion
if command -v python3 &> /dev/null; then
SECRET_KEY=$(python3 -c "import secrets; print(secrets.token_hex(32))" 2>/dev/null)
if [ ! -z "$SECRET_KEY" ]; then
echo "💡 Suggested SECRET_KEY: $SECRET_KEY"
echo ""
# Automatically fill in the secret key
sed -i "s/SECRET_KEY=your_secret_key_for_encryption_here/SECRET_KEY=$SECRET_KEY/" .env
echo "✅ SECRET_KEY automatically generated and set!"
echo ""
fi
fi
echo "📂 Creating required directories..."
mkdir -p data logs
echo ""
echo "🔧 Next steps:"
echo "1. Edit .env file and fill in the required values"
echo "2. Install dependencies: pip install -r requirements.txt"
echo "3. Run the bot: python main.py"
echo ""
echo "📖 For detailed setup instructions, see README.md"