✨
简介
Discord Purge Bot
原始描述
Operate a Discord message cleanup workflow with an official bot token and Discord HTTP API. Use when asked to purge guild channel history, delete messages by...
通过你的 Agent 添加
安装目录:discord-purge-bot/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
Claude Code~/.claude/skills/discord-purge-bot/
Codex CLI~/.codex/skills/discord-purge-bot/
DeepSeek Harness~/.agents/skills/discord-purge-bot/
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: discord-purge-bot
description: "Operate a Discord message cleanup workflow with an official bot token and Discord HTTP API. Use when asked to purge guild channel history, delete messages by user/keyword/time window, run dry-run previews, execute guarded bulk deletion jobs, or recreate a channel for fast wipe. Do not use for self-bot cleanup or personal DM history wipe."
Discord Purge Bot
Run controlled cleanup in Discord guild channels with safety gates and audit-friendly outputs.
Safety Contract
- Use only a bot token (
DISCORD_BOT_TOKEN or --token).
- Refuse user-account token flows and self-bot behavior.
- Run
purge-preview.mjs first for every destructive request.
- Require explicit confirmation code before running deletion.
- Abort if channel is not a guild channel.
- Keep logs and JSON summaries for each run.
Workflow
- Collect scope:
channel-id, optional author-id, contains, regex, after, before.
- Read
references/discord-limits.md before deletion runs.
- Run preview to estimate impact and get confirm code.
- Run deletion with confirm code.
- Share summary: scanned, matched, deleted, failed, old-vs-recent split.
Commands
Preview
node scripts/purge-preview.mjs \
--channel-id 123456789012345678 \
--author-id 987654321098765432 \
--contains "error" \
--after "2026-03-01T00:00:00Z" \
--max-scan 5000 \
--out ./tmp/purge-preview.json
Run Purge
node scripts/purge-runner.mjs \
--channel-id 123456789012345678 \
--author-id 987654321098765432 \
--contains "error" \
--after "2026-03-01T00:00:00Z" \
--confirm "PURGE-XXXXXXXX" \
--state-file ./tmp/purge-state.json \
--out ./tmp/purge-result.json
Dry Run
DISCORD_BOT_TOKEN or --token).purge-preview.mjs first for every destructive request.- Collect scope:
channel-id, optionalauthor-id,contains,regex,after,before. - Read
references/discord-limits.mdbefore deletion runs. - Run preview to estimate impact and get confirm code.
- Run deletion with confirm code.
- Share summary: scanned, matched, deleted, failed, old-vs-recent split.
Commands
Preview
node scripts/purge-preview.mjs \
--channel-id 123456789012345678 \
--author-id 987654321098765432 \
--contains "error" \
--after "2026-03-01T00:00:00Z" \
--max-scan 5000 \
--out ./tmp/purge-preview.json
Run Purge
node scripts/purge-runner.mjs \
--channel-id 123456789012345678 \
--author-id 987654321098765432 \
--contains "error" \
--after "2026-03-01T00:00:00Z" \
--confirm "PURGE-XXXXXXXX" \
--state-file ./tmp/purge-state.json \
--out ./tmp/purge-result.json
node scripts/purge-runner.mjs --channel-id 123456789012345678 --confirm "PURGE-XXXXXXXX" --dry-run
Clone or Nuke Channel
node scripts/purge-nuke.mjs --channel-id 123456789012345678 --confirm "NUKE-XXXXXXXX" --out ./tmp/nuke.json
node scripts/purge-nuke.mjs --channel-id 123456789012345678 --confirm "NUKE-XXXXXXXX" --delete-old --out ./tmp/nuke.json
Script Roles
scripts/purge-preview.mjs: scan channel messages, apply filters, return counts and confirm code.
scripts/purge-runner.mjs: execute deletion with 2-week split (bulk-delete + single delete fallback).
scripts/purge-nuke.mjs: create replacement channel; optionally delete original channel.
scripts/scan-filter.mjs: reusable scan and filtering logic.
scripts/discord-api.mjs: Discord API wrapper with rate-limit retries.
scripts/job-code.mjs: deterministic confirm code helpers.
Operator Rules
- Keep
max-scan bounded for broad channels.
- Use
--state-file on long jobs.
- Prefer content/user/time filters over whole-channel wipes.
- Use nuke mode only when preserving channel history is unnecessary.
- Treat pinned messages as protected unless
--include-pinned is set.
Troubleshooting
- 401/403: verify bot token and channel permissions.
- Empty preview with expected history: check
READ_MESSAGE_HISTORY.
- Heavy 429: reduce parallelism and keep retry handling enabled.
bulk-delete failures: expect messages older than 14 days, runner falls back to single deletes.
node scripts/purge-nuke.mjs --channel-id 123456789012345678 --confirm "NUKE-XXXXXXXX" --out ./tmp/nuke.json
node scripts/purge-nuke.mjs --channel-id 123456789012345678 --confirm "NUKE-XXXXXXXX" --delete-old --out ./tmp/nuke.json
scripts/purge-preview.mjs: scan channel messages, apply filters, return counts and confirm code.scripts/purge-runner.mjs: execute deletion with 2-week split (bulk-delete+ single delete fallback).scripts/purge-nuke.mjs: create replacement channel; optionally delete original channel.scripts/scan-filter.mjs: reusable scan and filtering logic.scripts/discord-api.mjs: Discord API wrapper with rate-limit retries.scripts/job-code.mjs: deterministic confirm code helpers.
Operator Rules
- Keep
max-scan bounded for broad channels.
- Use
--state-file on long jobs.
- Prefer content/user/time filters over whole-channel wipes.
- Use nuke mode only when preserving channel history is unnecessary.
- Treat pinned messages as protected unless
--include-pinned is set.
Troubleshooting
- 401/403: verify bot token and channel permissions.
- Empty preview with expected history: check
READ_MESSAGE_HISTORY.
- Heavy 429: reduce parallelism and keep retry handling enabled.
bulk-delete failures: expect messages older than 14 days, runner falls back to single deletes.
max-scan bounded for broad channels.--state-file on long jobs.--include-pinned is set.- 401/403: verify bot token and channel permissions.
- Empty preview with expected history: check
READ_MESSAGE_HISTORY. - Heavy 429: reduce parallelism and keep retry handling enabled.
bulk-deletefailures: expect messages older than 14 days, runner falls back to single deletes.
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。
标签
同类 Skill
✨
self-improving-agent
self-improving-agent
下载 416.7k
✨
self-improving-agent
self-improving-agent
下载 416.7k
✨
self-improving-agent
self-improving-agent
下载 416.7k
✨
self-improving-agent
self-improving-agent
下载 416.7k
✨
Self-Improving + Proactive Agent
Self-Improving + Proactive Agent
下载 177.1k
✨
Gog
Gog
下载 165k