RefenseBot is a moderation bot built around the concept of Refense, the balance between offense and defense.
RefenseBot RefenseBot is an AI-powered Discord moderation bot built around the philosophy of Refense, the balance between offense and defense. This Bot has functionality limited per server, so moderation between servers does not carry over. By analyzing behavior across messages, Refender measures 4 parameters: Hate, Sexual, Concern, and Scam to assess user risk over time. It tracks dangerous behavior, highlights patterns, and helps communities maintain balance.
Core Idea Every message is analyzed and scored across four major categories:
Hate Covers toxicity, harassment, threats, and violent intent.
Sexual Covers sexual content, including severe escalations.
Concern Covers self-harm and distress indicators.
Scam Covers scam indicators, typically from Mr. Beast scams
These scores are combined into a Danger Score, which contributes to a persistent user risk profile.
Instead of averaging all messages, Refender stores the Top 10 most dangerous messages from each user and calculates their overall danger based on those peak behaviors.
This preserves important signals and prevents dangerous behavior from being diluted by normal conversation.
Features AI-Powered Text Moderation Uses multiple machine learning models to classify message content:
KoalaAI moderation model Toxic-BERT ensemble scoring FalconsAI NSFW scoring EasyOCR for image text extraction Behavioral Risk Profiling Tracks:
User danger score Flagged message count Category averages Top 10 most dangerous messages Slash Command Interface Classification /classify text
Classify raw text input.
/classify id
Classify an existing message by ID.
/classify user
Classify a user's danger level
Risk Analysis /leaderboard
Display the highest-risk users in the server.
Architecture Refender is structured for scalability:
Database Design Guild Stores:
Guild ID Name UserProfile Stores:
Discord ID Username Danger Score Total Messages Cached other user data DangerMessage Stores:
Message content Timestamp Category scores Danger score Each user keeps only their highest-risk messages for efficient behavioral modeling.
Tech Stack Python discord.py SQLAlchemy SQLite Hugging Face Transformers PyTorch
Disclaimer AI moderation is imperfect.
Refender is designed to assist moderators, not replace them. Context, intent, and human judgment remain critical.
5
1 review
Reviews can be left only by registered users. All reviews are moderated by Top.gg moderators. Please make sure to check our guidelines before posting.
5 stars
1
4 stars
0
3 stars
0
2 stars
0
1 star
0