Environment variables
The bot uses environment variables for configuration. All variables should be defined in a.env file in the root directory.
Required variables
The bot will not start without these variables. It validates their presence on startup in
src/index.ts.DISCORD_TOKEN
Your Discord bot token from the Discord Developer Portal..env
src/index.ts
CLIENT_ID
Your Discord application’s client ID, required for deploying slash commands..env
Open Developer Portal
Optional variables
GUILD_ID
A Discord server (guild) ID for testing. When set, commands deploy instantly to this guild instead of globally..env
Global vs Guild deployment:
- Guild deployment: Instant, but commands only work in the specified server
- Global deployment: Takes up to 1 hour to propagate, but works in all servers
GUILD_ID during development, then remove it for production.LOG_LEVEL
Optional logging level for debugging. When set todebug, the bot will output detailed platform check results and internal operations.
.env
Available values:
debug- Show all logs including platform checks- Not set (default) - Show only info, warnings, and errors
src/utils/logger.ts:
Environment file example
Your complete.env file should look like this:
.env
Discord permissions
The bot requires specific permissions to function properly.Gateway Intents
Enable these intents in the Discord Developer Portal under Bot > Privileged Gateway Intents:Guilds
Required to receive guild events and access server information
Guild Messages
Required to send notifications and interact with channels
Bot Permissions
When generating an invite link, ensure these permissions are selected:| Permission | Required | Purpose |
|---|---|---|
| Send Messages | Yes | Send stream notifications |
| Embed Links | Yes | Display rich stream embeds |
| Use External Emojis | Yes | Show platform emojis (🟢 🟣 🔴) |
The minimum permission integer is
18432 (Send Messages + Embed Links + Use External Emojis)Command Permissions
Some commands require elevated permissions:| Command | Required Permission | Purpose |
|---|---|---|
/streamer add | Manage Channels | Prevents non-moderators from adding streamers |
/streamer remove | Manage Channels | Prevents non-moderators from removing streamers |
/streamer list | None | Anyone can view tracked streamers |
/help | None | Anyone can access help |
/ping | None | Anyone can check bot status |
Bot invite URL
Generate an invite URL with the correct permissions:
Your invite URL will look like:
Data storage
The bot uses Enmap for persistent storage with zero configuration required.No database setup needed - Enmap automatically creates and manages local database files.
Stored data
The bot stores the following data per Discord server:- Tracked streamers (username, platform, notification channel)
- Live status cache (current stream title, viewer count)
- Last alert timestamp (prevents duplicate notifications)
Data location
Enmap creates adata directory in the bot’s root folder with SQLite databases:
Advanced configuration
Polling interval
The bot checks streamer status every 60 seconds by default. This is hardcoded in the polling loop. To adjust the interval, modify the polling implementation in the codebase:Shorter intervals provide faster alerts but increase API request load. 60 seconds is recommended for reliability.
Error handling
The bot includes global error handlers that log errors and prevent crashes:src/index.ts
Production deployment
For production environments:Next steps
Usage guide
Learn how to use bot commands and manage streamer notifications