Spam Module

Tracks all channels it is active on for spammers. Each message someone sends generates "pressure", which decays rapidly. Long messages, messages with links, or messages with pings will generate more pressure. If a user generates too much pressure, they will be silenced and the moderators notified. Also detects groups of people joining at the same time and alerts the moderators of a potential raid.

Configuration

spam.autosilence

Gets the current autosilence state. Use the !autosilence command to set this.

spam.basepressure

The base pressure generated by sending a message, regardless of length or content. Defaults to 10

spam.ignorerole

If set, the bot will exclude anyone with this role from spam detection. Use with caution.

spam.imagepressure

Additional pressure generated by each image, link or attachment in a message. Defaults to (MaxPressure - BasePressure) / 6 = 8.3, instantly silencing anyone posting 6 or more links at once.

spam.lengthpressure

Additional pressure generated by each individual character in the message. Discord allows messages up to 2000 characters in length. Defaults to (MaxPressure - BasePressure) / 8000 = 0.00625, silencing anyone posting 3 huge messages at the same time.

spam.linepressure

Additional pressure generated by each newline in the message. Defaults to (MaxPressure - BasePressure) / 70 = 0.714, silencing anyone posting more than 70 newlines in a single message

spam.lockdownduration

Determines how long the server's verification mode will temporarily be increased to tableflip levels after a raid is detected. If set to 0, disables lockdown entirely.

spam.maxchannelpressure

Per-channel pressure override. If a channel's pressure is specified in this map, it will override the global maxpressure setting.

spam.maxpressure

The maximum pressure allowed. If a user's pressure exceeds this amount, they will be silenced. Defaults to 60, which is intended to ban after a maximum of 6 short messages sent in rapid succession.

spam.maxremovelookback

Number of seconds back the bot should delete messages of a silenced user on the channel they spammed on. If set to 0, the bot will only delete the message that caused the user to be silenced. If less than 0, the bot won't delete any messages.

spam.pingpressure

Additional pressure generated by each unique ping in a message. Defaults to (MaxPressure - BasePressure) / 20 = 2.5, instantly silencing anyone pinging 20 or more people at once.

spam.pressuredecay

The number of seconds it takes for a user to lose Spam.BasePressure from their pressure amount. Defaults to 2.5, so after sending 3 messages, it will take 7.5 seconds for their pressure to return to 0.

spam.raidsize

Specifies how many people must have joined the server within the spam.raidtime period to qualify as a raid.

spam.raidtime

In order to trigger a raid alarm, at least spam.raidsize people must join the chat within this many seconds of each other.

spam.repeatpressure

Additional pressure generated by a message that is identical to the previous message sent (ignores case). Defaults to BasePressure, effectively doubling the pressure penalty for repeated messages.

AutoSilence

!autosilence <all/raid/off>

Toggles the auto silencer for raids. This does not affect spam detection, only new members joining the server.

all/raid/off

all will autosilence all new members. raid will turn on autosilence if a raid is detected and silence any raiders automatically, then disengage it after spam.raidtime*2 seconds. off disables auto-silence.

Wipe

!wipe <channel> <seconds> [MESSAGES]

Removes all messages in a channel sent within the last N seconds, or simply removes the last N messages if "messages" is appended.

channel

The channel to delete from. You must use the #channel format so discord actually highlights the channel, otherwise it won't work.

seconds

Specifies the number of seconds to look back. The command deletes all messages sent up to this many seconds ago.

MESSAGES

(optional) If you append "MESSAGES" to the end of the command, it will remove that many messages, instead of looking back that many seconds.

GetPressure

!getpressure <user>

Gets the current spam pressure of a user.

user

User to retrieve pressure from.

GetRaid

!getraid

Lists all users that are considered part of the most recent raid, if there was one.

BanRaid

!banraid

Bans all users that are considered part of the most recent raid, if there was one. Use !getraid to check who will be banned before using this command.