diff options
| author | salmon <salmonik@tuta.io> | 2026-08-13 01:28:08 +0200 |
|---|---|---|
| committer | salmon <salmonik@tuta.io> | 2026-08-13 01:28:08 +0200 |
| commit | ec57015d5fcbbdb0bd624e0e6186cc01768165d1 (patch) | |
| tree | 5619ad54fc5f5b4579b837280f762be50c0577aa | |
| parent | init (diff) | |
| download | timeoutinator-master.tar.gz timeoutinator-master.zip | |
| -rw-r--r-- | README.md | 39 |
1 files changed, 6 insertions, 33 deletions
| @@ -1,6 +1,6 @@ | |||
| 1 | # Timeoutinator | 1 | # Timeoutinator |
| 2 | 2 | ||
| 3 | A Discord bot that instantly **timeouts** anyone who posts in a configured channel and **purges** all of their messages from the last 24 hours. | 3 | Get 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 | ||
| 11 | 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. | 11 | 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. |
| 12 | 12 | ||
| 13 | ## Setup | 13 | ## Quickly invite the bot: |
| 14 | |||
| 15 | ### 1. Create a Discord Application | ||
| 16 | |||
| 17 | 1. Go to [discord.com/developers/applications](https://discord.com/developers/applications) | ||
| 18 | 2. Click **New Application** → name it → **Bot** tab → **Add Bot** | ||
| 19 | 3. Under the bot, click **Reset Token** and copy the token — this is your `DISCORD_TOKEN` | ||
| 20 | |||
| 21 | ### 2. Enable Required Intents | ||
| 22 | |||
| 23 | In the **Bot** tab, scroll to **Privileged Gateway Intents**. | ||
| 24 | The 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 | |||
| 28 | Use this URL (replace `YOUR_BOT_CLIENT_ID` with the bot's Client ID from the **General Information** tab): | 14 | Use 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 |
| 46 | cp .env.example .env # or export the env vars directly | 32 | cp .env.example .env |
| 47 | # edit .env with your token and target channel ID | 33 | # edit the .env |
| 48 | 34 | ||
| 49 | cargo run --release | 35 | cargo run --release |
| 50 | ``` | 36 | ``` |
| 51 | 37 | Use 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) | ||
