← 返回 Skills 市场
Discord Purge Bot
作者
JunhuaShao
· GitHub ↗
· v0.1.2
443
总下载
0
收藏
1
当前安装
3
版本数
在 OpenClaw 中安装
/install 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...
使用说明 (SKILL.md)
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_TOKENor--token). - Refuse user-account token flows and self-bot behavior.
- Run
purge-preview.mjsfirst 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, 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
Dry Run
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-scanbounded for broad channels. - Use
--state-fileon 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-pinnedis 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-deletefailures: expect messages older than 14 days, runner falls back to single deletes.- Cannot reach Discord behind a proxy: export
HTTP_PROXY/HTTPS_PROXY(uppercase recommended) and run withNODE_USE_ENV_PROXY=1, or use a recent Node that supportssetGlobalProxyFromEnv(). - If your proxy tool exposes both HTTP and SOCKS ports, point
HTTP_PROXY/HTTPS_PROXYat the HTTP port;ALL_PROXY=socks5://...alone is not enough for this skill.
Proxy Example
export HTTP_PROXY=http://127.0.0.1:7890
export HTTPS_PROXY=http://127.0.0.1:7890
export NODE_USE_ENV_PROXY=1
node scripts/purge-preview.mjs --channel-id 123456789012345678 --max-scan 200
安全使用建议
This skill appears to implement the claimed purge functionality, but the registry metadata is inconsistent with the code and docs. Before installing or running it: (1) Treat your Discord bot token as sensitive — supply only a bot token (never a user account token). The scripts require DISCORD_BOT_TOKEN or --token even though the skill metadata doesn't declare it. (2) Ensure Node.js is installed and that the environment running these scripts is trusted; the metadata doesn't list 'node' as a required binary. (3) Review the included scripts yourself (they call only discord.com API endpoints and write JSON state files) and test in a non-production/test guild or channel. (4) Verify the bot has only the minimal permissions needed (VIEW_CHANNEL, READ_MESSAGE_HISTORY, MANAGE_MESSAGES, MANAGE_CHANNELS if using nuke) and enable auditing/monitoring. (5) Prefer running the preview flow first and require the confirmation code before destructive runs. If the registry owner cannot explain why credentials/binaries are omitted from metadata, treat the omission as a red flag and do not provide your production bot token.
功能分析
Type: OpenClaw Skill
Name: discord-purge-bot
Version: 0.1.2
The discord-purge-bot skill is a well-structured tool for managing Discord message deletion with significant built-in safety mechanisms. It implements a mandatory two-step workflow (preview before execution) and uses deterministic confirmation codes (generated in scripts/job-code.mjs) to ensure that deletion parameters match the previewed scope. The code handles Discord's API limits correctly, including the 14-day bulk-delete restriction and rate-limiting (scripts/discord-api.mjs), and lacks any indicators of data exfiltration, obfuscation, or unauthorized execution.
能力评估
Purpose & Capability
The skill is a Discord purge tool and legitimately needs a bot token and Node.js to run. However, the registry metadata lists no required env vars, no primary credential, and no required binaries — despite SKILL.md and the code (resolveToken and node scripts) requiring DISCORD_BOT_TOKEN or --token and invocation via node. This mismatch is material and unexplained.
Instruction Scope
SKILL.md and the scripts constrain behavior to Discord HTTP API calls, preview/run workflows, confirm codes, and writing JSON audit artifacts. The runtime instructions do not instruct wide data collection or external exfiltration and only reference proxy env vars for HTTP routing. This is consistent with the stated purpose, but the documentation expects you to pass a bot token and run Node commands (e.g., node scripts/purge-runner.mjs).
Install Mechanism
There is no install spec (instruction-only plus included scripts), which is lower risk than downloading arbitrary binaries. The code will run as Node.js scripts; no remote downloads or obscure installers are present. Still, the package includes executable scripts that will be written to disk when installed locally — ensure you run them in a controlled environment.
Credentials
The code expects a sensitive credential (DISCORD_BOT_TOKEN or --token) and may read HTTP_PROXY/HTTPS_PROXY/NO_PROXY env vars for networking. The metadata does not declare the bot token as a required credential or list Node as a required binary. Requiring a bot token is proportionate to the task, but the omission in metadata is a security/administrative concern that could cause accidental misuse (e.g., providing a user token).
Persistence & Privilege
The skill does not request permanent 'always' inclusion, does not modify other skills, and only writes state/result JSON to paths you specify via CLI flags. It can run autonomously by default (platform default), but that is not combined with any other high-privilege or opaque behavior here.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install discord-purge-bot - 安装完成后,直接呼叫该 Skill 的名称或使用
/discord-purge-bot触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.2
Add proxy-aware Discord API support and publish UI metadata.
v0.1.1
Republish from local workspace
v0.1.0
Initial release: Discord guild channel purge toolkit with preview, guarded run, and nuke workflow.
元数据
常见问题
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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 443 次。
如何安装 Discord Purge Bot?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install discord-purge-bot」即可一键安装,无需额外配置。
Discord Purge Bot 是免费的吗?
是的,Discord Purge Bot 完全免费(开源免费),可自由下载、安装和使用。
Discord Purge Bot 支持哪些平台?
Discord Purge Bot 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Discord Purge Bot?
由 JunhuaShao(@ginhoor)开发并维护,当前版本 v0.1.2。
推荐 Skills