The /alpha command system is fully implemented in Discord. If alerts aren't working, follow this step-by-step guide to diagnose and fix the issue.
Before troubleshooting, verify these requirements are met:
-
Environment Variables Set:
ALPHA_ALERTS_ENABLED=trueALPHA_DISCORD_ADMIN_IDS=<your_discord_user_id>DISCORD_BOT_TOKEN=<your_bot_token>DISCORD_CLIENT_ID=<your_client_id>
-
Admin Permissions:
- You must have Administrator, Manage Guild, or Manage Channels role in the Discord server
- OR your Discord user ID must be in
ALPHA_DISCORD_ADMIN_IDSenvironment variable
-
Channel Configuration:
- Run
/alpha setchannel #channel-nameto set the alert destination - Run
/alpha whereto verify channel is configured
- Run
-
Service Started:
- Run
/alpha startto start the monitoring service - Run
/alpha statusto check if service is running
- Run
Run /alpha debug (this command works even without admin permissions).
Expected output:
userId: 123456789012345678
guildId: 987654321098765432
hasGuildPerms: true
isAdminEnv: true
adminAllowlistSize: 1
inAllowlist: true
relayDisabled: false
If you see hasGuildPerms: false and isAdminEnv: false:
- Add your Discord user ID to
ALPHA_DISCORD_ADMIN_IDSenvironment variable - OR get Administrator/Manage Guild/Manage Channels role in the server
- Restart the bot after changing environment variables
How to get your Discord user ID:
- Enable Developer Mode in Discord Settings > App Settings > Advanced
- Right-click your username and select "Copy User ID"
- Add to Railway:
railway variables --set ALPHA_DISCORD_ADMIN_IDS=<your_user_id>
Run /alpha status
Expected output:
Alpha Status: running=true, callers=0/0, listeners=0, websockets=1
If running=false:
- Run
/alpha start - Check Railway logs for errors:
railway logs - Look for
[ALPHA ALERTS] Starting service...in logs
If service won't start:
- Check
ALPHA_ALERTS_ENABLED=truein Railway variables - Check RPC endpoints are configured (HELIUS_API_KEY or ALPHA_HTTP_RPC)
- Look for error messages in logs starting with
[ALPHA ALERT]
Run /alpha where
Expected output:
📍 Alpha alerts go to #alpha-alerts
If "No channel configured":
- Run
/alpha setchannel #your-channelto set the channel - Bot must have Send Messages permission in that channel
- Bot must be able to @mention @everyone (needs Mention Everyone permission)
Check Railway logs for this message when bot starts:
[Discord Bot] Alpha alert relay config - botRelay: true | direct: false | hasDirectTargets: false | relayEnv:
✅ Alpha alert callback registered for Discord
If you see "Skipping Discord alpha alert bot relay":
- This means ALPHA_ALERTS_DIRECT_SEND=true and direct webhook is configured
- Alerts will go to ALPHA_DISCORD_WEBHOOK URL instead of bot relay
- Either clear ALPHA_ALERTS_DIRECT_SEND or set ALPHA_ALERTS_BOT_RELAY=true
Run /alpha add <wallet_address> <name>
Example:
/alpha add 7BgBvyjrZX1YKz4oh9mjb8ZScatkkwb8DzFx7LoiVkM3 "Test Trader"
Check status after adding:
/alpha status
You should see callers=1/1 (1 monitored out of 1 total).
Use the debug endpoint to trigger a test alert:
curl -X POST https://your-app.railway.app/debug/alpha-testCheck Railway logs for:
[ALPHA ALERTS] Sending alert - Type: caller_signal | Mint: So11111... | Source: Test Wallet
[ALPHA ALERTS] Triggering 1 callback(s)
[ALPHA ALERTS] ✅ Callback executed successfully
[Discord Bot] Alpha alert received - Type: caller_signal | Mint: So11111... | Source: Test Wallet
[Discord Bot] Total alpha targets: 1
[Discord Bot] Discord targets: 1
[Discord Bot] Attempting to send to channel 1234567890 in guild 9876543210
[Discord Bot] ✅ Alert sent successfully to channel 1234567890
If no Discord targets:
- Run
/alpha setchannel #your-channelagain - Verify with
/alpha where - Check database: Query
alphaTargetstable for platform='discord'
If alert not sent to channel:
- Check bot permissions in that channel (Send Messages, Embed Links, Mention Everyone)
- Try a different channel
- Check channel is text or announcement type (not voice/forum/etc)
Solution:
- Run
/alpha debugto check permissions - Add your user ID to
ALPHA_DISCORD_ADMIN_IDS - OR get admin role in the server
- Restart bot after environment variable changes
Possible causes:
- Service not started - Run
/alpha start - No channel configured - Run
/alpha setchannel #channel - No wallets monitored - Run
/alpha add <wallet> <name> - Bot missing permissions - Check Send Messages, Mention Everyone
- Direct send mode active - Check ALPHA_ALERTS_DIRECT_SEND env var
Possible causes:
- Bot not invited with
applications.commandsscope - Slash commands not registered - Check logs for "Successfully reloaded Discord application (/) commands"
- Discord client cache - Restart Discord app
- Wrong bot token - Verify DISCORD_BOT_TOKEN and DISCORD_CLIENT_ID
Check logs for:
- WebSocket connection errors
- RPC rate limiting
- Database connection issues
- Memory/CPU limits reached on Railway
Solutions:
- Upgrade Railway plan for more resources
- Use Helius RPC (set HELIUS_API_KEY)
- Reduce number of monitored wallets
- Increase ALPHA_REFRESH_INTERVAL_MS (default 60000)
# Railway CLI
railway variables
# Look for these:
ALPHA_ALERTS_ENABLED=true
ALPHA_DISCORD_ADMIN_IDS=<your_user_id>
DISCORD_BOT_TOKEN=<token>
DISCORD_CLIENT_ID=<client_id>
ALPHA_ALERTS_DIRECT_SEND=false # or not set
ALPHA_ALERTS_BOT_RELAY=true # or not set (defaults to true)| Command | Description |
|---|---|
/alpha status |
Show service status (running, callers, listeners, websockets) |
/alpha start |
Start alpha monitoring service |
/alpha stop |
Stop alpha monitoring service |
/alpha debug |
Show permission diagnostics (works without admin) |
/alpha setchannel [#channel] |
Set alert destination channel |
/alpha clearchannel |
Clear configured channel |
/alpha where |
Show configured channel |
/alpha add <wallet> <name> |
Add wallet to monitor |
/alpha remove <wallet> |
Remove monitored wallet |
# Trigger test alert
curl -X POST https://your-app.railway.app/debug/alpha-test
# Check service status
curl https://your-app.railway.app/debug/alpha-status
# Send startup message
curl -X POST https://your-app.railway.app/debug/alpha-startup[ALPHA ALERTS] Sending alert - Type: caller_signal | Mint: ABC123... | Source: Trader
[ALPHA ALERTS] Triggering 1 callback(s)
[ALPHA ALERTS] ✅ Callback executed successfully
[Discord Bot] Alpha alert received - Type: caller_signal | Mint: ABC123... | Source: Trader
[Discord Bot] Total alpha targets: 1
[Discord Bot] Discord targets: 1
[Discord Bot] Attempting to send to channel 1234567890 in guild 9876543210
[Discord Bot] ✅ Alert sent successfully to channel 1234567890
[Discord /alpha] User username#1234 (ID: 123456789012345678) | Guild: 987654321098765432 | Subcommand: start
[Discord /alpha] PERMISSION DENIED for user 123456789012345678 | hasGuildPerms: false | isAdminEnv: false
[Discord Bot] Alpha alert received - Type: caller_signal | Mint: ABC123... | Source: Trader
[Discord Bot] Total alpha targets: 0
[Discord Bot] Discord targets: 0
[Discord Bot] ⚠️ No Discord targets configured. Use /alpha setchannel to configure.
Here's a complete example of setting up alpha alerts from scratch:
# 1. Set environment variables on Railway
railway variables --set ALPHA_ALERTS_ENABLED=true
railway variables --set ALPHA_DISCORD_ADMIN_IDS=123456789012345678
# 2. Restart service
railway up -d
# 3. In Discord, run these commands:
/alpha debug # Verify permissions
/alpha setchannel #alpha # Set channel
/alpha where # Verify channel
/alpha start # Start service
/alpha status # Check status
# 4. Add a wallet to monitor
/alpha add 7BgBvyjrZX1YKz4oh9mjb8ZScatkkwb8DzFx7LoiVkM3 "Alpha Trader"
# 5. Test alert delivery
curl -X POST https://your-app.railway.app/debug/alpha-test
# 6. Check logs
railway logs --tailIf you've followed all steps and alerts still aren't working:
-
Capture full logs:
railway logs --tail > alpha-debug.log -
Run all debug commands and document results:
/alpha debug/alpha status/alpha wherecurl https://your-app.railway.app/debug/alpha-status
-
Check Railway metrics:
- CPU usage (should be < 80%)
- Memory usage (should be < 80%)
- Network traffic (check for rate limiting)
-
Verify bot permissions in Discord:
- Go to Server Settings > Roles
- Find bot's role
- Check these permissions:
- Send Messages ✅
- Embed Links ✅
- Mention Everyone ✅
- Read Message History ✅
- Use Slash Commands ✅
-
Test with minimal configuration:
- Stop all other services
- Use only 1 monitored wallet
- Use only 1 Discord channel
- Monitor logs for any errors
- Alpha alerts require an active RPC connection (preferably Helius)
- Bot must be online and connected to Discord
- Channel must allow @everyone mentions for alerts to ping users
- Service auto-starts on deployment if
ALPHA_ALERTS_ENABLED=true - Nansen integration is optional (requires
NANSEN_API_KEY) - Direct send mode bypasses bot relay and uses webhooks instead