-
-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Julian Speckmann edited this page Jan 27, 2026
·
1 revision
This page explains all configuration options available in the .env file.
- Type: String
- Description: Your Discord bot token from the Developer Portal
-
Example:
MTIzNDU2Nzg5MDEyMzQ1Njc4OQ.GhIjKl.MnOpQrStUvWxYz1234567890AbCdEfGhIjKl -
Security:
⚠️ Keep this secret! Never commit it to version control.
- Type: String (Snowflake ID)
- Description: Your Discord application ID
-
Example:
1234567890123456789 - Where to find: Discord Developer Portal → Your App → General Information
- Type: String
- Description: Your SourceXchange API bearer token
-
Example:
MTIzNDU2Nzg5MDEyMzQ1Njc4OQ.GhIjKl.MnOpQrStUv -
Security:
⚠️ Keep this secret! Never commit it to version control.
- Type: String
- Description: The SourceXchange product ID to check purchases against
-
Example:
123 - Note: Users must own this product to receive the Discord role
- Type: String (Snowflake ID)
- Description: The Discord role ID to grant/revoke based on product ownership
-
Example:
9876543210987654321 - Where to find: Right-click role in Discord → Copy ID (requires Developer Mode)
- Type: String
-
Options:
productionordevelopment -
Default:
production -
Description: Controls logging verbosity
-
development: Verbose logging with debug information -
production: Standard logging only
-
-
Never commit
.envto git- The
.envfile is in.gitignoreby default - Always use
.env.examplefor templates
- The
-
Rotate tokens regularly
- Regenerate your Discord bot token periodically
- Update your SourceXchange API token if compromised
-
Use environment-specific tokens
- Use separate tokens for development and production
- Never use production tokens in development
-
Restrict bot permissions
- Only grant necessary Discord permissions
- Use role hierarchy to prevent privilege escalation
To fix hierarchy issues:
- Go to Server Settings → Roles
- Drag your bot's role above the role specified in
DISCORD_ROLE_ID - Save changes
Currently, the bot supports one product per instance. For multiple products:
Run separate bot instances with different configurations:
# Bot 1
PRODUCT_ID=123 DISCORD_ROLE_ID=9876543210987654321 npm start
# Bot 2
PRODUCT_ID=456 DISCORD_ROLE_ID=7172391210987645282 npm startFork the project and modify index.js to support multiple product mappings.
NODE_ENV=development- Logs all API requests and responses
- Shows detailed error messages
- Displays command execution details
NODE_ENV=production- Logs only important events
- Hides sensitive debug information
- Optimized for performance
See the Troubleshooting page for common configuration issues.