A "Vibe Coded" system to control the personality and rules of a Discord Bot using a modern Web Dashboard.
- Web Dashboard: discord-copilot-thax.vercel.app
- Bot Backend: discord-copilot-bcwd.onrender.com (Health Check)
- 🧠 Brain: Define your bot's persona (System Instructions) in real-time.
- 🛡️ Security: Allow-list specific Discord channels; the bot ignores everything else.
- 🔒 Secure Auth: Email/Password authentication restricts Dashboard access to Admins only.
- 📜 Logs: Watch chat interactions happen live on the Dashboard (Supabase Realtime).
- 🧹 Memory Control: Reset the bot's conversation context with a single click.
- 🤖 AI: Powered by Google Gemini (Flash 1.5/2.5) for fast, intelligent responses.
- Web App: Next.js 14, Tailwind CSS, Shadcn/UI.
- Bot: Node.js, Discord.js v14, Google Generative AI SDK.
- Backend: Supabase (PostgreSQL + Realtime).
- Node.js v18+ installed.
- Supabase Project: With
profiles,bot_config, andchat_logstables. - Discord App: Create one at Discord Developer Portal.
- Gemini API Key: Get one from Google AI Studio.
The Control Center for your bot.
- Navigate to the web folder:
cd web - Install dependencies:
npm install
- Set up environment:
Create
.env.local:NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
- Run development server:
Access at
npm run dev
http://localhost:3000. (Note: You will be redirected to Login. Use the Sign Up link or create a user in Supabase Authentication dashboard).
The agent living in your server.
- Navigate to the bot folder:
cd bot - Install dependencies:
npm install
- Set up environment:
Create
.env:DISCORD_TOKEN=your_discord_bot_token GEMINI_API_KEY=your_gemini_api_key SUPABASE_URL=your_supabase_url SUPABASE_KEY=your_supabase_anon_key
- Start the bot:
node index.js
- Invite Bot: Use the OAuth2 URL Generator in Discord Dev Portal (Scopes:
bot, Perms:Send Messages,View Channels). - Configure Channel:
- In Discord, Right-click channel -> Copy Channel ID (Enable Developer Mode in User Settings if missing).
- In Web Dashboard -> Configuration -> Add the ID.
- Set Personality:
- In Web Dashboard -> Brain -> Write instructions (e.g., "You are a very rude pirate"). -> Save.
- Chat:
- Talk in the allowed channel. The bot will respond in character!
- Watch the Logs tab in the dashboard to see it happen live.
- Bot Not Replying? Check if the Channel ID is in the "Allowed Channels" list.
- Crash on Start? Ensure
bot_configtable has at least one row (Save something in the Dashboard first). - Empty Logs? Ensure Supabase Realtime is enabled for the
chat_logstable. - Bot Still a Pirate? Click "Clear Memory" in the Logs tab to wipe the old context (the bot uses persistent database logs).