Docs: Add purge command to README and AGENTS-BOT.md
All checks were successful
Auto Build and Push Docker Image / build (push) Successful in 7s
All checks were successful
Auto Build and Push Docker Image / build (push) Successful in 7s
- Added purge subcommands to admin command list - Documented purge implementation details in AGENTS-BOT.md - Listed Discord API constraints (100 message limit, 14 day filter) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -351,6 +351,29 @@ if (unit === 'perm') {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 11. Purge Command (Message Deletion)
|
||||||
|
|
||||||
|
**Subcommands:**
|
||||||
|
- `purge amount <1-100>` - Delete X messages
|
||||||
|
- `purge time <duration> <min|hour>` - Delete messages from last X time
|
||||||
|
- `purge user <user> <1-100>` - Delete X messages from specific user
|
||||||
|
- `purge all` - Delete all possible messages (max 100)
|
||||||
|
|
||||||
|
**Discord API Constraints:**
|
||||||
|
- Max 100 messages per bulk delete
|
||||||
|
- Messages older than 14 days cannot be bulk deleted
|
||||||
|
- Requires `ModerateMembers` permission
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Filter messages older than 14 days (Discord API limit)
|
||||||
|
const twoWeeksAgo = Date.now() - 14 * 24 * 60 * 60 * 1000;
|
||||||
|
const filtered = messages.filter((m: any) => m.createdTimestamp > twoWeeksAgo);
|
||||||
|
|
||||||
|
await channel.bulkDelete(filtered, true);
|
||||||
|
```
|
||||||
|
|
||||||
|
**Logging:** Purge actions are logged to the moderation log channel with event type `messages`.
|
||||||
|
|
||||||
## 🚀 Build & Deploy
|
## 🚀 Build & Deploy
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -388,5 +411,5 @@ docker-compose up -d --build
|
|||||||
| `/timer` | add, remove, list, listall, help | Public/Admin |
|
| `/timer` | add, remove, list, listall, help | Public/Admin |
|
||||||
| `/welcome` | setchannel, add, remove, list, help | Admin |
|
| `/welcome` | setchannel, add, remove, list, help | Admin |
|
||||||
| `/log` | setchannel, enable, disable, list, help | Admin |
|
| `/log` | setchannel, enable, disable, list, help | Admin |
|
||||||
| `/admin` | kick, warn, unwarn, mute, unmute, ban, unban, config, help | Admin |
|
| `/admin` | kick, warn, unwarn, mute, unmute, ban, unban, purge, config, help | Admin |
|
||||||
| `/owner` | deploy, stats, servers, help | Owner |
|
| `/owner` | deploy, stats, servers, help | Owner |
|
||||||
@@ -93,6 +93,10 @@ npm run deploy
|
|||||||
- `/admin unmute <user>` – Nutzer entmuten
|
- `/admin unmute <user>` – Nutzer entmuten
|
||||||
- `/admin ban <user>` – Nutzer bannen
|
- `/admin ban <user>` – Nutzer bannen
|
||||||
- `/admin unban <id>` – Nutzer entbannen
|
- `/admin unban <id>` – Nutzer entbannen
|
||||||
|
- `/admin purge amount <1-100>` – X Nachrichten löschen
|
||||||
|
- `/admin purge time <dauer> <min|hour>` – Nachrichten der letzten X Zeit löschen
|
||||||
|
- `/admin purge user <user> <1-100>` – X Nachrichten eines Nutzers löschen
|
||||||
|
- `/admin purge all` – Alle Nachrichten löschen (max 100)
|
||||||
- `/admin config` – Warn-System konfigurieren
|
- `/admin config` – Warn-System konfigurieren
|
||||||
- `/admin help` – Admin-Hilfe
|
- `/admin help` – Admin-Hilfe
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user