Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

discord-guard-bot

Server protection bot: anti-nuke, anti-raid, anti-spam.

Setup

pip install -r requirements.txt
cp .env.example .env

Fill DISCORD_TOKEN in .env with a bot token from the Discord Developer Portal. Enable these privileged intents on the bot: Server Members Intent, Message Content Intent. Invite the bot with permissions: Manage Roles, Kick Members, Ban Members, Manage Channels, Moderate Members, View Audit Log.

Run

python bot.py

Configuration (slash commands, requires Manage Server)

  • /guard status - show current config
  • /guard setlog #channel - set alert channel
  • /guard whitelist_add @member / /guard whitelist_remove @member
  • /guard nuke_threshold count window_seconds
  • /guard nuke_punishment strip_roles|kick|ban
  • /guard raid_threshold count window_seconds
  • /guard raidmode on|off
  • /guard toggle anti_nuke|anti_raid|anti_spam enabled:true|false

How it works

  • Anti-nuke watches audit log entries for channel/role deletion, mass channel creation, bans, webhook creation. If the same executor exceeds the threshold within the window, roles are stripped (or the executor is kicked/banned depending on config) and an alert is posted.
  • Anti-raid tracks join rate. Once the threshold is hit, raid mode auto-enables and kicks new joiners whose account age is below the configured minimum until disabled.
  • Anti-spam tracks message rate per member per guild, purges the burst and times the member out.

Per-guild config is stored as JSON under guard/data/<guild_id>.json.

About

Discord Anti-Raid Bot / Nuke Protect bot, designed to prevent against nuke bot.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages