Install
openclaw skills install discord-bulk-message-deleteUse when user requests deleting multiple Discord messages or channel cleanup. Triggers on phrases like: - "delete [X] messages" - "purge [X] messages" - "cle...
openclaw skills install discord-bulk-message-deleteA Python script for deleting messages from Discord channels without requiring npm/discord.js dependencies. Uses only Python standard library + requests.
Location: /scripts/discord-purge-tool.py (in the subfolder of the skill)
Create token.json in the workspace directory:
{
"token": "tokenhere"
}
OR set environment variable:
$env:DISCORD_TOKEN = "YOUR_BOT_TOKEN_HERE"
From this skill's directory:
# Delete last 5 messages
python scripts/discord-purge-tool.py --channel-id <CHANNEL_ID>
# Delete custom count
python scripts/discord-purge-tool.py purge 25 --channel-id <CHANNEL_ID>
# Larger purge (handles batches automatically)
python scripts/discord-purge-tool.py purge 200 --channel-id <CHANNEL_ID>
# Delete last X messages (default: 5)
python scripts/discord-purge-tool.py purge <count> --channel-id <CHANNEL_ID>
# Auto-detect channel from context if mentioned earlier
python scripts/discord-purge-tool.py purge 50
Discord enforces:
The tool handles this transparently, so you don't need to worry about it.
Your Discord bot must have MANAGE_MESSAGES permission in target channels:
{
"token": "YOUR_BOT_TOKEN_HERE"
}
Or environment variable:
$env:DISCORD_TOKEN = "YOUR_BOT_TOKEN_HERE"
| Command | Description |
|---|---|
python scripts/discord-purge-tool.py purge <count> --channel-id <id> | Delete last N messages |
python scripts/discord-purge-tool.py 5 --channel-id <id> | Delete last 5 (default) |
The bot doesn't have MANAGE_MESSAGES permission. Fix by:
DISCORD_TOKEN env variable and running from this skill's directoryCheck that:
scripts/discord-purge-tool.pyDISCORD_TOKEN env variable is set