Environment Variables
Jill Stingray uses environment variables for all configuration. Create a.env file in the project root with the following settings.
Required Variables
These variables are required for the bot to function:PostgreSQL connection string for persistent data storage.Format:Examples:
utils/db.js (Line 4)
The bot automatically creates all required tables on startup. No manual schema setup needed.
Optional API Keys
These variables enable specific features:Supabase project URL for cloud storage (image uploads, palette generation).Example:
utils/supabase.js (Line 5)
Required for
/palette command and any features that upload images to cloud storage.Supabase service role key for bypassing Row Level Security (RLS).Example:
utils/supabase.js (Line 6)
Mapillary API token for Geoguessr street imagery.Get a token: Mapillary Developer PortalExample:
commands/geo.js (Line 24)
Without this token:
- Geoguessr falls back to cached locations from
data/fallback_cache.json - If cache is empty, uses hardcoded Tokyo location
- Fetches random street-level imagery globally
- Supports Africa, Asia, Americas, Europe, and Oceania regions
Groq API key for AI-powered 8ball responses.Get a key: Groq ConsoleExample:
commands/8ball.js (Line 6)
Only required for
/8ball command. Other commands function normally without it.Your Discord user ID for bot owner permissions.Find your ID:
utils/permissions.js (Line 3)
- Enable Developer Mode in Discord (User Settings → Advanced)
- Right-click your username → Copy ID
HTTP server port for health checks and keep-alive.Example:The bot exposes a simple HTTP endpoint that responds with:
index.js (Line 105)
Example Configuration
Feature Requirements
Different features require different environment variables:Core Bot Features
Core Bot Features
Required:
DISCORD_TOKENDATABASE_URL
- All basic commands (
/help,/ping,/userinfo, etc.) - Moderation tools (
/mute,/role,/purge) - Activity tracking and regulars system
- Custom role management
- Trigger system
Drink Mixing
Drink Mixing
Required:
DISCORD_TOKENDATABASE_URL
- None (uses TheCocktailDB public API)
/mix classic- Real-world cocktails/mix special- VA-11 HALL-A drinks/menu- Browse drink database/tab- View drink order history
data/va11_drinks.json- VA-11 HALL-A drink recipesdata/images/*.png- Drink images
Geoguessr
Geoguessr
Required:
DISCORD_TOKENDATABASE_URL
MAPILLARY_TOKEN- For live street imagery
/geo host- Start Geoguessr game/geo quit- End game- Interactive map navigation
- Live scoring and leaderboards
commands/geo.js (Lines 476-485)
Color Palettes
Color Palettes
Required:
DISCORD_TOKENDATABASE_URLSUPABASE_URLSUPABASE_SERVICE_KEY
/palette- Generate color palettes from images- Image upload to Supabase storage
- Public URL generation
@napi-rs/canvas for image processing and palette extraction.AI 8ball
AI 8ball
Required:Fallback:
If Groq fails, uses static responses from
DISCORD_TOKENDATABASE_URLGROQ_API_KEY
/8ball- AI-powered fortune telling- Groq LLaMA model integration
data/8ball_responses.jsonDatabase Configuration
The bot automatically creates these tables on startup:See
utils/db.js (Lines 8-133) for the complete database initialization code.Supabase Setup
If using Supabase for image storage:Create Supabase Project
Sign up at supabase.com and create a new project.
Create Storage Bucket
Go to Storage in the Supabase dashboard and create a new bucket:
- Name:
jill-stingray(or your preferred name) - Public: Yes (required for Discord embeds)
- File size limit: 50MB
Get API Credentials
Go to Settings → API:
- Copy Project URL →
SUPABASE_URL - Copy service_role key →
SUPABASE_SERVICE_KEY
Validation
Verify your configuration:- Check Environment
- Test Database
- Check Bot Logs
Security Best Practices
Rotate Tokens
Regenerate Discord bot tokens and API keys if exposed
Use Service Role
Always use Supabase service_role key for server-side operations
Restrict Database
Use SSL and IP whitelisting for production databases
Environment Variables
Use platform environment variables in production, not .env files
Next Steps
Server Setup
Configure admin roles and server-specific settings
Commands
Browse the complete command reference
Features
Explore drink mixing and other features
Deployment
Deploy to production with Railway, Heroku, or VPS