DCleaner Bot is a high-performance Discord maintenance bot built for server owners, developers, and power users who want fast, rule-based channel cleanup and creation with zero bloat.
Now with advanced features, user-friendly interface, and both JavaScript and Python versions!
Built for automation-heavy servers, dev environments, and large Discord communities. Perfect for both technical and non-technical users.
🔗 GitHub: https://github.com/terminalskid/dcleaner
👤 Author: terminalskid
- Remove individual channels or bulk channels
- Remove channels based on multiple criteria:
- Name contains specific text
- Name starts with / ends with text
- Age-based deletion (older than X days)
- Category-based deletion
- Empty channel detection
- Custom rule combinations
You define conditions, the bot enforces them with precision.
Supported Rules:
- Delete channels containing specific words
- Delete channels starting/ending with patterns
- Delete channels older than X days
- Delete channels in specific categories
- Whitelist protection (channels and categories)
- Case-insensitive matching
- Create channels programmatically
- Bulk-create channels with custom names
- Category-aware creation
- Position-aware creation
- Emoji + pipe-style names supported (
🎉┃events)
- Interactive setup wizard (
/dsetup) for first-time users - Preview mode (
/dpreview) to see what would be deleted - Confirmation prompts for destructive operations
- Rich embeds with detailed information
- Help system (
/dhelp) with comprehensive guides - Configuration management via Discord commands
- No database required
- No collectors
- No message listeners
- Slash-command driven
- Single-pass filtering
- Minimal memory footprint
- Rate-limit protection built-in
- Dry-run mode (preview only, no actual deletions)
- Confirmation prompts before destructive operations
- Whitelist protection for important channels
- Category whitelisting for entire categories
- Detailed logging with timestamps
- Error handling and recovery
- Rate limit protection (configurable delays)
- Node.js 18+
- discord.js v14
- ES Modules
- Zero external services
- Zero UI dependencies
- Python 3.8+
- discord.py 2.3+
- python-dotenv for environment variables
- Same features as JavaScript version
git clone https://github.com/terminalskid/dcleaner
cd dcleaner
npm installgit clone https://github.com/terminalskid/dcleaner
cd dcleaner
pip install -r requirements.txtCreate a .env file (or set environment variables):
TOKEN=YOUR_BOT_TOKENor
DISCORD_TOKEN=YOUR_BOT_TOKENThe bot will not start without a token. Both
TOKENandDISCORD_TOKENare supported.
npm startor
node index.jspython bot.pyor
python3 bot.py| Command | Description |
|---|---|
/dhelp |
Get comprehensive help and learn how to use DCleaner |
/dsetup |
Interactive setup wizard for first-time users |
/dpreview |
Preview what would be deleted (safe, no changes) |
/dclean |
Clean channels based on configured rules |
/dcreate |
Create default channels |
/dstats |
Show server statistics and channel information |
| Command | Description |
|---|---|
/dconfig view |
View current configuration |
/dconfig dryrun |
Toggle dry-run mode (preview only) |
/dconfig add-rule |
Add a deletion rule (contains/starts/ends) |
/dconfig remove-rule |
Remove a deletion rule |
/dconfig whitelist list |
List all whitelisted channels |
/dconfig whitelist add-channel |
Add a channel to whitelist |
/dconfig whitelist remove-channel |
Remove a channel from whitelist |
- Invite the bot to your server with Administrator permissions
- Run
/dsetupto see the interactive setup wizard - Run
/dpreviewto see what channels would be deleted (safe!) - Configure rules using
/dconfig add-ruleif needed - Whitelist important channels using
/dconfig whitelist add-channel - Run
/dcleanwhen ready (it will ask for confirmation)
- Clone the repository
- Install dependencies (
npm installorpip install -r requirements.txt) - Set
TOKENenvironment variable - Run the bot
- Configure via commands or edit
config.jsondirectly
The bot automatically creates and manages a config.json file. You can edit it directly or use commands:
{
"DRY_RUN": false,
"DELETE_IF_NAME_CONTAINS": ["ticket", "old", "spam", "temp"],
"DELETE_IF_NAME_STARTS_WITH": ["closed-", "log-"],
"DELETE_IF_NAME_ENDS_WITH": [],
"DELETE_IF_OLDER_THAN_DAYS": null,
"WHITELIST_CHANNEL_IDS": [],
"WHITELIST_CATEGORY_IDS": [],
"RATE_LIMIT_DELAY": 1000,
"REQUIRE_CONFIRMATION": true
}- DRY_RUN:
true= preview only,false= actual deletion - DELETE_IF_NAME_CONTAINS: Array of strings to match in channel names
- DELETE_IF_NAME_STARTS_WITH: Array of strings that channel names start with
- DELETE_IF_NAME_ENDS_WITH: Array of strings that channel names end with
- DELETE_IF_OLDER_THAN_DAYS: Number of days (null to disable)
- WHITELIST_CHANNEL_IDS: Array of channel IDs to protect
- WHITELIST_CATEGORY_IDS: Array of category IDs to protect
- RATE_LIMIT_DELAY: Delay between operations in milliseconds (JavaScript) or seconds (Python)
- REQUIRE_CONFIRMATION: Ask for confirmation before deleting
- Auto-clean ticket spam channels
- Reset test servers instantly
- Enforce channel naming policies
- Remove scam/spam channels
- Dev servers that regenerate channels constantly
- Partner/ad server hygiene
- Clean up old/unused channels
- Remove channels from specific categories
The bot requires:
Manage Channels- To create/delete channelsView Channels- To see channel listAdministrator- Recommended for full functionality
Note: Users running commands need Administrator permissions.
When enabled, the bot will show you what would be deleted without actually deleting anything. Perfect for testing!
/dconfig dryrun enabled:true
/dpreview # See what would be deletedBefore deleting channels, the bot will ask for confirmation (unless disabled). You'll see:
- List of channels to be deleted
- Count of channels
- Confirm/Cancel buttons
Protect important channels from deletion:
# Get channel ID: Right-click channel → Copy ID
/dconfig whitelist add-channel channel_id:123456789012345678The bot automatically adds delays between operations to respect Discord's rate limits. Configurable via RATE_LIMIT_DELAY.
- Single-pass channel scanning
- No polling loops
- No database IO
- No message events
- Slash commands only
- Optimized for large servers (1k+ channels)
- Rate-limit safe operations
- Check that
TOKENorDISCORD_TOKENis set - Verify the token is valid
- Check bot has required permissions in server
- Wait a few minutes for Discord to sync commands
- Re-invite bot with
applications.commandsscope - Check bot is online
- Ensure bot has
Manage Channelspermission - Ensure user has
Administratorpermission - Check channel hierarchy (bot role must be above channels)
- Check file permissions
- Verify
config.jsonis writable - Check console for error messages
DCleaner is meant to be extended.
You can easily add:
- Time-based rules
- Role-based protection
- Auto-clean on schedule
- Multi-guild configs
- Preset cleanup profiles
- CI/CD triggered cleanup
- Custom rule engines
- Integration with other bots
If you can write JavaScript or Python — you can extend it.
The /dstats command shows:
- Total channels
- Text/Voice/Category counts
- Channels that would be deleted
- Whitelisted channels
- Current configuration status
No. It's a server maintenance & hygiene tool.
Yes — rules are explicit, deterministic, and reviewable. Always use /dpreview first!
Yes, all operations are logged to console with timestamps.
Yes. Speed is the core goal. Optimized for large servers.
Yes, but not simultaneously with the same bot token. Choose one version.
- JavaScript: If you're familiar with Node.js
- Python: If you prefer Python or want to extend with Python libraries
Both versions have identical features.
Yes, but you'll need a hosting service (VPS, cloud, etc.) or a computer that's always on.
MIT License
Free to use, modify, and distribute.
PRs are welcome if they:
- Improve performance
- Add deterministic features
- Fix bugs
- Improve user experience
- Add documentation
- Maintain code quality
"If you can express it as a rule, the bot should enforce it, fast. - Skid"
DCleaner is built for speed, safety, and simplicity. It does one thing well: channel management.
- ✅ Added interactive setup wizard
- ✅ Added preview mode
- ✅ Added confirmation prompts
- ✅ Added comprehensive help system
- ✅ Added configuration management commands
- ✅ Added whitelist management
- ✅ Added statistics command
- ✅ Added Python version
- ✅ Improved error handling
- ✅ Better logging
- ✅ Configuration file support
- ✅ Rich embeds for better UX
- ✅ Rate limit protection
- ✅ Advanced filtering options
Built with ❤️ by terminalskid
Special thanks to the Discord.js and discord.py communities.