Anti-Invite
Automatically remove Discord invite links
Anti-invite scans messages for Discord invite links, resolves each one, and removes the message unless it is exempt. It is a premium feature.
Setup
Run /setup anti-invite. The command takes no options; it opens a dashboard where you configure everything: the on/off toggle, a log channel, excluded channels, excluded roles, the member threshold, the action to take, and a list of allowed servers.
What it detects
It matches discord.gg/..., discord.com/invite/... and discordapp.com/invite/..., with or without http or www. Other link shorteners and vanity redirectors (for example dsc.gg) are not detected.
Actions
- Delete (default): removes the message.
- Delete and warn: also posts a warning that deletes itself after 8 seconds.
- Delete and timeout: also times the member out for 10 minutes. This needs the Moderate Members permission.
The timeout length and warning lifetime are fixed and cannot be changed.
Exemptions
A message is allowed if any of these is true, checked in order: anti-invite is off, the channel is excluded, the author has an excluded role, the invite points to this server, the target server is on your allowed list, or the target server has at least the member threshold you set.
Catches and limits
- Expired or invalid invites cannot be resolved, and those messages are deleted anyway.
- The member threshold is a “big servers are fine” allowlist. It defaults to 0, which exempts every server that resolves. Raise it to make the filter stricter.
- If a message contains several links and even one is not exempt, the whole message is removed.
- The bot needs Manage Messages. If it loses that permission in a channel, links there are silently left alone.
- If the bot loses Moderate Members after you pick the timeout action, messages are still deleted but the timeout is skipped.
- A log channel needs Embed Links and Send Messages, or logging is silently skipped.
- Enforcement shares the same rate limits as the rest of the bot. During a heavy raid it can stop acting once those limits are hit.
- You cannot add your own server to the allowed list.