aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: d79dcbf96d9c476a9412ae96a24f4f355938fe3c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Timeoutinator

Get rid of spammers with this one shrimple trick.

## How it works

1. User sends a message in the policed channel.
2. Bot immediately times them out (`Moderate Members` — configurable duration, default 1 hour).
3. Bot bulk-deletes every message that user posted **in any channel of the guild** over the past 24 hours (including the triggering message).

Bots, system messages, and webhook messages are ignored. The bot's own messages are also ignored. Concurrent handling of the same user is deduplicated so rapid-fire spam doesn't cause duplicate timeouts or purge races.

## Quickly invite the bot:
Use this URL (replace `YOUR_BOT_CLIENT_ID` with the bot's Client ID from the **General Information** tab):

```
https://discord.com/api/oauth2/authorize?client_id=YOUR_BOT_CLIENT_ID&permissions=1099511702528&scope=bot
```

Required permissions (encoded in the URL):

| Permission              | Why                                      |
|-------------------------|------------------------------------------|
| View Channels           | See the policed channel and the channels to purge                  |
| Read Message History    | Fetch messages to purge                  |
| Manage Messages         | Delete messages via bulk-delete endpoint |
| Moderate Members        | Apply timeouts                           |

### Run

```bash
cp .env.example .env
# edit the .env

cargo run --release
```
Use systemd/rc.d/docker/whatever the fuck you want for persistence.