Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

PolarBot

PolarBot is a Discord moderation bot with a live scam and spam scanner. One process serves any number of Discord servers; each server configures it with slash commands.

What it does

  • Scam and spam scanner. Every new and edited message in the scanned channels gets a score from 0 to 100, computed locally in about a millisecond, from its links (about 250 000 known phishing domains, lookalike and Unicode-homoglyph domains, punycode, shorteners, masked links), its text (scam phrases, also in leetspeak; “move to Snapchat”-style funnels) and the author’s behaviour (the same link in many channels, floods). Links to adult sites are a separate rule that never applies in age-restricted channels.
  • Mod cards in the log channel with Scam, Not scam and Undo buttons. Moderators decide; confirmed scam domains go on the server’s block list.
  • Moderation commands: /ban, /unban, /kick, /timeout, /untimeout, /warn, /warnings, /modlog, /lookup, with PolarBot’s own permission levels (/perms) and hierarchy checks.
  • Logging from level 0 (nothing) to 10 (every event), batched so busy servers stay within Discord’s rate limits.
  • Command visibility: after /perms authorize, each role sees only the commands its level allows.
  • /help, /about and /privacy also work in a DM with the bot.

New servers start with the scanner on and actions enabled at the default thresholds (log 60, delete 90, punish 97 with a 1 hour timeout). Servers that had PolarBot before the scanner existed start in log-only mode. Try the scanner safely with /scanner analyze.

What you need

Operating systemLinux with systemd 250 or newer (for encrypted credentials): Debian 12+, Ubuntu 24.04+, Fedora 38+. Windows is not supported yet.
Hardware1 CPU core and 512 MB RAM are plenty for a few large servers (the unit caps memory at 1 GB). Building from source needs about 2 GB RAM and 3 GB disk.
NetworkOutbound HTTPS to Discord and to the domain lists. Inbound only if you use command visibility: HTTPS (443) and, for the certificate, HTTP (80).
DiscordAn application with a bot user, the three privileged intents enabled, and the bot invited with the right permissions (Install).
OptionalA domain name and nginx for the OAuth callback (command visibility).

Where to go next