Discord Bot
Real-time protection for your servers — scan URLs shared in any channel and warn on suspicious links.
How it works
The bot watches channels it can see and checks every shared URL against the Phisherman engine. It posts a verdict per link — red malicious (score ≥ 70), yellow suspicious (40–69), or green safe — and can delete confirmed malicious messages when enabled.
In agent mode the bot takes configuration in chat (settings, keys, per-channel mute) and reports problems instead of failing silently.
Install
For a hosted agent, open the invite link, pick a server, and authorize. The bot posts a welcome message and scanning is already on for every channel it can see.
Self-hosting requirements
- A Discord application with a bot token (Discord Developer Portal → App → Bot)
- Message Content Intent enabled so the bot can read URLs
- Invite scopes/permissions: Send Messages, Embed Links, Read Message History, Manage Messages (Manage Messages enables auto-deletion)
Configuration
Copy the example and set your token. Environment variables take precedence over config.json.
Commands
| Command | Description |
|---|---|
| !scan <url> | Manually scan a URL |
| !status | Agent status + API-key health |
| !settings [key value] | View/change behavior (admins) |
| !mute / !unmute | Pause/resume this channel |
| !key <ph_...> | Set a per-team API key (admins) |
| !help | Show help |
Settings
| Setting | Default | Meaning |
|---|---|---|
| delete_malicious_messages | off | Delete confirmed malicious messages |
| warn_on_suspicious | on | Post a warning for suspicious URLs |
| post_all_results | off | Also report safe URLs |
| alert_on_error | on | Post a notice when scanning fails (e.g. bad key) |
Running the bot
Run locally:
Or as a container (recommended for always-on hosting):
Verify
In a channel the bot can see, run !status, then send https://example.com — it should reply SAFE (score 0).
Troubleshooting
| Symptom | Fix |
|---|---|
| Bot sees no messages | Enable Message Content Intent and re-invite the bot |
| Bot starts then exits | A token is missing — check docker compose logs discord |
| 429 responses | Rate limited — add a ph_ API key |