-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
91 lines (81 loc) · 3.08 KB
/
Copy pathsetup.sh
File metadata and controls
91 lines (81 loc) · 3.08 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/env bash
set -e
echo ""
echo "============================================"
echo " ChatRobber - Discord Conversation Logger"
echo " Quickstart Setup (macOS / Linux)"
echo "============================================"
echo ""
# ── Check Node.js ──────────────────────────────
echo "[1/4] Checking for Node.js..."
if ! command -v node &> /dev/null; then
echo ""
echo "ERROR: Node.js is not installed or not in your PATH."
echo ""
echo "Install Node.js 18+ from: https://nodejs.org"
echo " macOS (Homebrew): brew install node"
echo " Ubuntu / Debian: curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs"
echo ""
echo "Then re-run this script."
exit 1
fi
NODE_VER=$(node --version)
echo " Found Node.js $NODE_VER"
# ── Install dependencies ───────────────────────
echo ""
echo "[2/4] Installing dependencies (npm install)..."
npm install
echo " Dependencies installed successfully."
# ── Create .env if needed ──────────────────────
echo ""
echo "[3/4] Checking for .env file..."
if [ -f ".env" ]; then
echo " .env already exists — skipping creation."
else
if [ -f ".env.example" ]; then
cp .env.example .env
echo " Created .env from .env.example"
else
cat > .env << 'ENVEOF'
DISCORD_TOKEN=
DEEPGRAM_API_KEY=
OPENROUTER_API_KEY=
# Optional settings (defaults shown)
# SUMMARY_INTERVAL_MINUTES=10
# DEEPGRAM_MODEL=nova-3
# DEEPGRAM_LANGUAGE=en
# CHUNK_MODEL=google/gemini-2.0-flash-001
# FINAL_MODEL=google/gemini-2.0-flash-001
# DEBUG=false
ENVEOF
echo " Created new .env file"
fi
echo ""
echo " ┌──────────────────────────────────────────────┐"
echo " │ Open .env in a text editor and paste your │"
echo " │ three API keys: │"
echo " │ │"
echo " │ DISCORD_TOKEN (Developer Portal) │"
echo " │ DEEPGRAM_API_KEY (console.deepgram.com) │"
echo " │ OPENROUTER_API_KEY (openrouter.ai/keys) │"
echo " └──────────────────────────────────────────────┘"
echo ""
# Try to open in an editor
if command -v code &> /dev/null; then
code .env
elif command -v nano &> /dev/null; then
nano .env
elif command -v vi &> /dev/null; then
vi .env
else
echo " No editor detected — please open .env manually."
fi
echo ""
read -rp " Press Enter once you have saved your .env file..."
fi
# ── Start the bot ──────────────────────────────
echo ""
echo "[4/4] Starting ChatRobber..."
echo " (Press Ctrl+C to stop the bot)"
echo ""
npm start