Ban anyone who posts in the honeypot channel unless they have the @Staff role, delete their message, DM them the reason first, log every catch in #mod-logs, and let me choose to kick instead of ban
Honeypot Moderator automatically catches and removes bad actors who post in a designated trap channel.
How it works:
Setup: Configure these settings in the dashboard:
Perfect for catching raiders, bots, or alt accounts that mass-join and post immediately.
Made by MEE6. Remix it to get a copy of your own and change anything you like.
You have been banned from Test server for posting in a restricted channel.
// Honeypot moderation: auto-ban/kick anyone who posts in a trap channel
// unless they have a staff role. Deletes the message, DMs them the reason
// and logs to mod-logs.
mee6.settings({
honeypot_channel: {
type: 'channel',
label: 'Honeypot channel (trap for bad actors)',
required: true,
sample: 'honeypot',
},
mod_log_channel: {
type: 'channel',
label: 'Moderation log channel',
required: true,
sample: 'mod-logs',
},
staff_role: {
type: 'role',
label: 'Staff role (immune to honeypot)',
required: true,
sample: 'Staff',
},
action: {
type: 'string',
label: 'Action to take',
choices: ['ban', 'kick'],
default: 'ban',
},
});
// Only messages in the honeypot channel wake the module
mee6.on('message', { channels: [mee6.setting('honeypot_channel')] }, async (ctx) => {
// Check settings are configured
if (!ctx.settings.mod_log_channel || !ctx.settings.staff_role) {
mee6.log('Honeypot triggered but settings not fully configured');
return;
}
// Staff are immune
if (ctx.author.roles.includes(ctx.settings.staff_role)) {
mee6.log(`Staff member ${ctx.author.username} posted in honeypot - ignoring`);
return;
}
const action = ctx.settings.action || 'ban';
const actionPast = action === 'ban' ? 'banned' : 'kicked';
const reason = `Posted in honeypot channel`;
// Take the bait down right away, so nobody else sees or clicks it.
// A failed delete (no Manage Messages) must not spare the poster.
let baitDeleted = true;
try {
await ctx.delete();
} catch (e) {
baitDeleted = false;
mee6.log(`Could not delete the honeypot message: ${e}`);
}
// DM them before the action closes the DM
const dmSent = await mee6.dm(
ctx.author.id,
`You have been ${actionPast} from **${ctx.guild.name}** for posting in a restricted channel.`
);
// Take action
if (action === 'ban') {
await mee6.ban(ctx.author.id, { reason, deleteMessageDays: 1 });
} else {
await mee6.kick(ctx.author.id, reason);
}
// Log to mod channel
await ctx.send(ctx.settings.mod_log_channel, {
embed: {
title: `🍯 Honeypot Catch: ${action === 'ban' ? 'Banned' : 'Kicked'}`,
description: `**${ctx.author.username}** (${ctx.author.mention}) ${actionPast} for posting in <#${ctx.settings.honeypot_channel}>`,
fields: [
{ name: 'User ID', value: ctx.author.id, inline: true },
{ name: 'Action', value: action, inline: true },
{ name: 'DM Sent', value: dmSent ? 'Yes' : 'No (DMs closed)', inline: true },
{ name: 'Message Deleted', value: baitDeleted ? 'Yes' : 'No (missing Manage Messages?)', inline: true },
{ name: 'Message', value: ctx.message.content || '*No text content*' },
],
color: action === 'ban' ? 0xed4245 : 0xfee75c,
timestamp: new Date().toISOString(),
footer: { text: `Honeypot Moderator` },
},
});
mee6.log(`${actionPast} ${ctx.author.username} for posting in honeypot`);
});