⚡ Discord Auto-Defense System — Hacker Style Edition
Webixly Security Bot is a powerful Discord security system that blocks spam, mass mentions, message floods, and unauthorized activity automatically. Every action is logged in the modlog channel.
- Python 3.8+
- Libraries:
* `discord.py`
* `python-dotenv`
- Clone the repo:
git clone https://github.com/webixly/webixly-security-bot.git
cd webixly-security-bot- (Optional) Create virtual environment:
# Create virtual environment
python -m venv security-env
# Activate environment
# Windows:
security-env\Scripts\activate
# macOS/Linux:
source security-env/bin/activate- Install dependencies:
pip install discord.py python-dotenv- Create a
.envfile:
DISCORD_TOKEN=YOUR_BOT_TOKEN_HERE
RESTRICTED_CHANNEL_ID=1234567899999999999
MODLOG_CHANNEL_ID=1234567899999999999
GUILD_ID=123456789012345678- Run the bot:
python discordBot.pyExpected output:
✅ Logged in as Webixly Security Bot (ID: 123456789012345678)
- Automatic spam detection & banning
- Restricted channels with instant ban
- Duplicate/rapid message defense
- Mass mention detection
- Message history wipe on ban
- Full moderation logs
Check if the bot is online.
!ping
Response:
🏓 Pong! Bot is online and secured.
Set a protected channel where any message sent triggers an instant ban.
!setrestricted #channel
Or:
!setrestricted channel_name
What happens:
-
Saves channel as restricted
-
Pins automatic warning
-
Any user message triggers:
- Message deletion
- Cleanup of history
- Instant ban
- Log entry
When you set a channel as restricted:
-
A pinned warning is created
-
Any message sent triggers:
- Message deletion
- Instant ban
- Removal of last 5 minutes of messages
- Log in modlog channel
{
"msg_threshold": 5,
"time_window": 7,
"duplicate_threshold": 4,
"mention_threshold": 5,
"delete_history_minutes": 5
}bot.py— main script.env— environment variablesconfig.json— settings
!setrestricted #security-zone✅ !whitelist add @user
Add user to whitelist (exempt from security rules).
!whitelist add @username
Remove user from whitelist.
!whitelist remove @username
Display current whitelist.
!whitelist show
#⚙️ Spam Configuration (Admin Only)
Adjust message threshold limit.
#!spam threshold 6
Adjust monitoring time window.
!spam window 10
Adjust duplicate message threshold.
!spam duplicate 3
##Adjust mention limit threshold.
!spam mentions 4
Display current spam configuration.
!spam settings
Anyone typing there gets banned instantly + logs recorded.
Feel free to open Issues or PRs. Follow existing code style and include clear descriptions.
MIT License — use freely with credit.
Developed by Pablo — Webixly Security Secure • Smart • Automatic