Discord Integration
CocoAntiVPN can send real-time VPN detection alerts to your Discord server using webhooks.
Setting Up Discord Webhook
Step 1: Create a Webhook
- Open your Discord server
- Go to the channel where you want alerts
- Click the gear icon (Edit Channel)
- Select Integrations
- Click Create Webhook
Step 2: Configure the Webhook
- Give your webhook a name (e.g., "CocoAntiVPN Alerts")
- Optionally upload an avatar
- Click Copy Webhook URL
Step 3: Add to Config
Paste the webhook URL in your config.yml:
discord-webhook-url: "https://discord.com/api/webhooks/1234567890/abcdefghijklmnop..."
Step 4: Reload
/antivpn reload
Alert Information
When a VPN user is detected, CocoAntiVPN sends a Discord notification with:
- Player name
- IP address
- Detection timestamp
- Server/Proxy name
Best Practices
Dedicated Channel
Create a dedicated channel for VPN alerts:
- Create channel
#vpn-alerts - Set permissions so only staff can view
- Create webhook in this channel
Rate Limiting
Discord has rate limits for webhooks. If you're under a bot attack:
- Alerts may be delayed
- Some alerts may be dropped
- This is normal Discord behavior
The plugin handles rate limits gracefully.
Security
Keep Your Webhook Private
Never share your webhook URL publicly. Anyone with the URL can send messages to your channel.
If your webhook is compromised:
- Go to channel settings
- Delete the compromised webhook
- Create a new webhook
- Update your config
Disabling Discord Alerts
To disable Discord integration, leave the URL empty:
discord-webhook-url: ""
Troubleshooting
Alerts Not Appearing
- Check URL: Ensure the full webhook URL is in config
- Check Channel: Verify webhook is in the correct channel
- Check Permissions: Bot must have "Send Messages" in channel
- Check Console: Look for webhook errors
Delayed Alerts
Discord webhook rate limits:
- 30 requests per minute per webhook
- During attacks, some alerts queue up
"Invalid Webhook" Errors
The webhook may have been deleted. Create a new one and update config.
Alternative: Staff Notifications
If you prefer in-game notifications over Discord:
- Leave
discord-webhook-urlempty - Grant staff the
antivpn.notifypermission - Staff will receive in-game messages:
[CocoVPN] Steve is using a VPN! (IP: 192.168.1.100)
You can use both simultaneously for comprehensive monitoring.