A TypeScript daemon that monitors Discord voice activity and Steam game launches, then sends notifications via WhatsApp/SMS using Twilio.
- 🎤 Discord Voice Monitoring: Detects when you join or leave voice channels
- 🎮 Steam Game Monitoring: Detects when you start or stop playing games
- 📱 SMS/WhatsApp Notifications: Sends messages via Twilio
- 🔧 Extensible: Easy to add more triggers (Minecraft, Spotify, etc.)
- 🚀 Background Daemon: Runs continuously in the background
- Node.js 16+ and npm
- Discord Bot Token (with appropriate permissions)
- Twilio Account (for SMS/WhatsApp notifications)
- Your Discord User ID and Server ID
npm install- Go to Discord Developer Portal
- Create a new application
- Go to "Bot" section and create a bot
- Enable these permissions:
- Read Messages/View Channels
- Voice States
- Presence Intent
- Copy the bot token
- Invite the bot to your server with appropriate permissions
- User ID: Right-click your username → Copy ID
- Server ID: Right-click server name → Copy ID
- Create a Twilio account
- Get your Account SID and Auth Token
- Get a Twilio phone number
- For WhatsApp, you'll need to use the Twilio WhatsApp sandbox initially
Copy the example environment file and fill in your details:
cp env.example .envEdit .env with your actual values:
# Discord Bot Configuration
DISCORD_BOT_TOKEN=your_discord_bot_token_here
DISCORD_USER_ID=your_discord_user_id_here
DISCORD_GUILD_ID=your_discord_server_id_here
# Twilio Configuration
TWILIO_ACCOUNT_SID=your_twilio_account_sid_here
TWILIO_AUTH_TOKEN=your_twilio_auth_token_here
TWILIO_PHONE_NUMBER=your_twilio_phone_number_here
TARGET_PHONE_NUMBER=your_target_phone_number_here
# Application Configuration
YOUR_NAME=YourName
CHECK_INTERVAL=5000npm run dev# Build the project
npm run build
# Start the daemon
npm startYou can run it as a background service using pm2:
# Install pm2 globally
npm install -g pm2
# Start the daemon
pm2 start dist/index.js --name activity-monitor
# Monitor logs
pm2 logs activity-monitor
# Stop the daemon
pm2 stop activity-monitorYou can run the daemon in Command Prompt or PowerShell:
npm run devor, for production:
npm run build
npm start- Install pm2 globally:
npm install -g pm2
- Start the daemon:
pm2 start dist/index.js --name activity-monitor
- To make pm2 auto-start on boot:
pm2 startup pm2 save
- To view logs:
pm2 logs activity-monitor
- To stop the daemon:
pm2 stop activity-monitor
- Download and install nssm.
- Open Command Prompt as Administrator.
- Install the service:
nssm install ActivityMonitorDaemon "C:\\Program Files\\nodejs\\node.exe" "C:\\path\\to\\your\\project\\dist\\index.js"
- Start the service:
nssm start ActivityMonitorDaemon
- To stop/remove:
nssm stop ActivityMonitorDaemon nssm remove ActivityMonitorDaemon
- Use a
.envfile in your project root, or set environment variables in Windows system settings.
- If Steam/game detection does not work, try running your terminal as Administrator.
- Whitelist your project folder in your antivirus/security software if needed.
The system is designed to be easily extensible. To add more triggers:
- Create a new monitor class implementing
ActivityMonitor - Add it to the main daemon in
src/index.ts - Update the message formatting logic
Example for adding Spotify monitoring:
// src/monitors/spotify.ts
export class SpotifyMonitor implements ActivityMonitor {
// Implementation here
}
// In src/index.ts, add:
private spotifyMonitor: SpotifyMonitor;
// Initialize and start itEdit src/monitors/steam.ts to add more games to monitor:
const STEAM_GAMES = [
// Add your games here
'your-game.exe',
'another-game.exe',
];- Ensure the bot has the correct permissions
- Check that the bot is in your server
- Verify your User ID and Server ID are correct
- Verify your Account SID and Auth Token
- Check that your Twilio number is active
- For WhatsApp, you may need to join the Twilio sandbox first
- On macOS, you might need to grant accessibility permissions
- Some games might use different executable names
MIT License - feel free to modify and distribute as needed.
Feel free to submit issues and enhancement requests!