aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md39
1 files changed, 6 insertions, 33 deletions
diff --git a/README.md b/README.md
index 7a8d638..d79dcbf 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
1# Timeoutinator 1# Timeoutinator
2 2
3A Discord bot that instantly **timeouts** anyone who posts in a configured channel and **purges** all of their messages from the last 24 hours. 3Get rid of spammers with this one shrimple trick.
4 4
5## How it works 5## How it works
6 6
@@ -10,21 +10,7 @@ A Discord bot that instantly **timeouts** anyone who posts in a configured chann
10 10
11Bots, 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. 11Bots, 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.
12 12
13## Setup 13## Quickly invite the bot:
14
15### 1. Create a Discord Application
16
171. Go to [discord.com/developers/applications](https://discord.com/developers/applications)
182. Click **New Application** → name it → **Bot** tab → **Add Bot**
193. Under the bot, click **Reset Token** and copy the token — this is your `DISCORD_TOKEN`
20
21### 2. Enable Required Intents
22
23In the **Bot** tab, scroll to **Privileged Gateway Intents**.
24The bot only needs **Message Content** if you want to read message content — by default, only `GUILD_MESSAGES` is required, which is non-privileged. No privileged intents are required.
25
26### 3. Invite the Bot
27
28Use this URL (replace `YOUR_BOT_CLIENT_ID` with the bot's Client ID from the **General Information** tab): 14Use this URL (replace `YOUR_BOT_CLIENT_ID` with the bot's Client ID from the **General Information** tab):
29 15
30``` 16```
@@ -40,25 +26,12 @@ Required permissions (encoded in the URL):
40| Manage Messages | Delete messages via bulk-delete endpoint | 26| Manage Messages | Delete messages via bulk-delete endpoint |
41| Moderate Members | Apply timeouts | 27| Moderate Members | Apply timeouts |
42 28
43### 4. Run 29### Run
44 30
45```bash 31```bash
46cp .env.example .env # or export the env vars directly 32cp .env.example .env
47# edit .env with your token and target channel ID 33# edit the .env
48 34
49cargo run --release 35cargo run --release
50``` 36```
51 37Use systemd/rc.d/docker/whatever the fuck you want for persistence.
52## Environment Variables
53
54| Variable | Required | Default | Description |
55|-----------------------|----------|---------|----------------------------------------------------------------|
56| `DISCORD_TOKEN` | ✅ | — | Bot token from the Discord Developer Portal |
57| `TARGET_CHANNEL_ID` | ✅ | — | Snowflake ID of the channel to police (right-click → Copy ID) |
58| `TIMEOUT_MINUTES` | ❌ | `60` | Timeout duration in minutes (1–40320, i.e. up to 28 days) |
59| `PURGE_HOURS` | ❌ | `24` | How far back (hours) to look when deleting messages |
60
61## Requirements
62
63- Rust 1.85+ (edition 2024)
64- Network access (to fetch crates and connect to Discord's gateway)