Verification systems are essential for any public Discord server. Without one, bots and raiders flood your server within days. Here is how to build effective verification using your own bot.
Why Verification Matters
Public Discord servers face three main threats:
- Spam bots - Automated accounts that join and immediately send phishing links or advertisements
- Raid bots - Coordinated account floods that mass-ping, spam, or crash your server
- Alt accounts - Banned users rejoining on new accounts to evade moderation
A proper verification gate stops the majority of these before they can interact with your community.
Verification Methods
Reaction-Based Verification
The simplest approach: post a rules message and require users to react with a specific emoji to gain access.
// Listen for reactions on the verification message
client.on('messageReactionAdd', async (reaction, user) => {
if (reaction.message.id !== VERIFY_MESSAGE_ID) return;
if (user.bot) return;
const member = await reaction.message.guild.members.fetch(user.id);
await member.roles.add(VERIFIED_ROLE_ID);
});
Pros: Easy to implement, low barrier for real users. Cons: Simple bots can automate reactions too.
CAPTCHA Verification
Send new members a DM with a code challenge:
- User joins → bot sends a DM with a simple math problem or scrambled word
- User replies with the answer
- Correct answer → verified role granted
- Wrong answers or timeout → kicked or kept unverified
This blocks most automated bots since they can't solve visual or logical challenges.
Account Age Filtering
Check account creation date and add delays for new accounts:
client.on('guildMemberAdd', async member => {
const accountAge = Date.now() - member.user.createdTimestamp;
const sevenDays = 7 * 24 * 60 * 60 * 1000;
if (accountAge < sevenDays) {
// Flag as suspicious, require extra verification
await member.roles.add(QUARANTINE_ROLE_ID);
}
});
Anti-Raid Detection
Beyond individual verification, monitor for raid patterns:
- Join rate monitoring - If 10+ accounts join within 60 seconds, trigger lockdown
- Message pattern detection - Flag identical messages sent by multiple new accounts
- Automatic lockdown - Temporarily restrict server permissions when a raid is detected
const joinTimestamps = [];
client.on('guildMemberAdd', async member => {
const now = Date.now();
joinTimestamps.push(now);
// Clean old timestamps (older than 60 seconds)
while (joinTimestamps.length > 0 && joinTimestamps[0] < now - 60000) {
joinTimestamps.shift();
}
if (joinTimestamps.length >= 10) {
// Trigger raid mode - lock server
await enableRaidMode(member.guild);
}
});
Server Setup
Structure your Discord server with verification in mind:
- #rules channel - visible to everyone, read-only
- #verify channel - where unverified members interact with the bot
- Verified role - grants access to all normal channels
- @everyone - should have minimal permissions by default
Best Practices
- Combine methods - reaction verify + account age check is stronger than either alone
- Log all verification attempts for moderation review
- Set a timeout - kick unverified members after 24-48 hours
- Make the process clear - confused new members leave permanently
- Test your system regularly - join on an alt to verify the experience
A solid verification system drastically reduces moderation workload and keeps your community safe. The time investment in building one pays off quickly.
