Trap channel
Set up a channel nobody should post in, and punish the self-bots and spam accounts that do.
A trap channel holds a standing warning and nothing else. Members read it and leave. Spam accounts that
post in every channel they find get punished at once. Every ,trap
command needs Manage Server.
Set up the trap
,trap setup makes a channel (needs Manage Channels) or
adopts one you name. Leave it visible: a trap nobody can see catches nothing. Threads inside it count
as part of the trap.
Syntax
,trap setup [#channel]
Example
,trap setup #do-not-post
Then whitelist anyone who must post there with
,trap whitelist, and check everything with
,trap settings.
Syntax
,trap whitelist <add|remove|list> [@role|@user]
Example
,trap whitelist add @Staff
Staff are not immune
Only the server owner, the bot owner and whitelisted users and roles are immune. An unwhitelisted Administrator is
punished like anyone else, and their own ,trap commands are deleted inside a trap channel before they
run. Configure it from another channel, or whitelist your staff role.
Choose the punishment
,trap action sets it; the default is softban.
Syntax
,trap action <softban|ban|kick|timeout|mute|jail> [duration]
Example
,trap action timeout 2h
| Action | Bot needs | Effect |
|---|---|---|
softban | Ban Members | Bans with a message purge, then unbans |
ban | Ban Members | Permanent |
kick | Kick Members | They can rejoin |
timeout | Moderate Members | One hour unless you give a duration |
mute | Manage Roles | Needs ,config muterole |
jail | Manage Roles | Needs ,config jailrole |
The caught message is deleted first and skips your snipe cache and delete logs. One trap embed goes to the ,config logchannel.
Punish repeat offenders harder
,trap escalation punishes a second catch harder. Off
by default; the escalation action is ban unless you name another. Counts come from punishment history,
so ,punishmenthistory clear resets
them and ,punishmenthistory remove on a trap
case takes one off.
Syntax
,trap escalation <on|off> [action]
Example
,trap escalation on ban
,trap joingate uses the escalation action on a first
catch when the account or membership is under 1 to 90 days old (default 7). Off by default. It uses the
escalation action even with escalation off, so ,trap escalation off timeout softens it.
Syntax
,trap joingate <on|off> [days]
Example
,trap joingate on 7
Restyle the warning
,trap counter shows or hides the embed and its count
(off is a silent trap). ,trap embed changes how it
looks: view returns the code your server runs, set replaces it, remove restores the default, and
resend posts a fresh one. Hiding the counter keeps your code; setting a code doesn't turn the counter on.
Syntax
,trap counter <on|off|reset|set> [count]
Example
,trap counter set 42
Syntax
,trap embed <view|set|remove|resend> [code]
Example
,trap embed set {color: #FF4747}$p{title: 🪤 Do not post here}$p{description: This channel is a trap. Anyone who posts is punished automatically: **{trap.action}**, no warning. Caught so far: **{trap.counter}**.}$p{footer: {guild.name} && {guild.icon}}🪤 DO NOT SEND MESSAGES IN THIS CHANNEL
This channel is a trap for spam bots. Anyone who posts here is punished automatically — no warning.
⚖️ Punishment
a softban
🤖 Caught
42
Righteous • whitelisted roles are exempt
Trap tokens: {trap.counter} (accounts caught), {trap.action} (punishment, written out), {trap.channel} (#name) and {trap.escalation} (the escalation punishment, or nothing when off).
Two things that silently go wrong
Nobody triggered the standing embed, so {user}, {user.mention} and {user.avatar} mean the bot
here. And {trap.escalation} is empty while escalation is off, so **{trap.escalation}** posts a
field of ****. The default adds that field only when escalation is on.
The warning must render an embed: {v2:} is refused on save, and {content:}, {button:},
{gallery:}, {section:} and {separator:} produce nothing. See Embed codes.
Tell the caught account what happened
,trap dm controls the DM a caught account gets (on by
default). It is sent before a ban or kick, the only moment it can still arrive.
Syntax
,trap dm <on|off> | invite <on|off> | embed <code|check|reset>
Example
,trap dm invite on
For your own wording, ,trap dm embed <code>. Here {user} is the caught account, and {action} is a
whole phrase ("softbanned (...)") naming the punishment that landed, so an escalated catch says "banned".
{trap.counter}, {trap.action} and {trap.escalation} don't work in a DM and post as literal text. A
DM code may use plain text, buttons and Components V2; ++delete is accepted and ignored.
The preview is not the DM
The reply you get on save shows {action} as the bare word (softban), {trap.channel} as your
primary trap, {user} as you, and no rejoin invite. The real DM differs on all four. Only a real
catch shows it.
The rejoin invite reaches softban and kick DMs only
Under ban, timeout, mute or jail, invite on saves and does nothing. The bot also needs a
non-trap channel where it may create an invite, or even a softban DM goes out without one. It is
appended to your code, so never write one yourself.
Run more than one trap
,trap channels adds up to five, each with its own
embed; the catch count is shared. The setup channel is primary and can't be removed: re-run
,trap setup to change it, which resets the list.
,trap randomize renames them every 1 to 168 hours
(default 24, off by default, needs Manage Channels) so the name can't be learned. Channels the bot can't
rename are left alone.
Syntax
,trap channels <add|remove|list> [#channel]
Example
,trap channels add #do-not-post-2
Syntax
,trap randomize <on|off> [hours]
Example
,trap randomize on 24
Review and remove
,trap stats reports totals by action, unique accounts,
repeats and the busiest days. ,trap disable removes the trap.
Syntax
,trap stats
Common issues
A moderator got banned by the trap. Whitelist them or their role with ,trap whitelist add.
Permissions never grant immunity.
My ,trap command did nothing. You ran it inside a trap channel without being owner or whitelisted,
so it was deleted unread. Run it elsewhere.
Someone posted and nothing happened. The punishment failed: a missing permission, a member above the bot, or no mute or jail role. The failure goes to your log channel, and with none set the bot posts nothing and says nothing, so set one first. The message is deleted either way.
The warning embed disappeared. Run ,trap embed resend.
