A lightweight Discord bot that cleans up channel messages — no database required.
/clean— Delete messages in the current channelolder_than(optional): Only delete messages older than a period (e.g.30s,15m,1h,1d)
/schedule— Manage recurring cleanup schedulesset: Schedule recurring cleanup with interval in minutes and optionalolder_thanfilterlist: List all active schedules in the current servercancel: Cancel the schedule in the current channel
- Requires the Manage Messages permission
- Node.js 22+
- A Discord Application with a bot token (Discord Developer Portal)
git clone https://github.com/ShibbityShwab/Custodian.git
cd Custodian
npm install- Go to the Discord Developer Portal.
- Create or select an Application.
- Note your Application ID, Public Key, and Bot Token.
cp .env.example .env| Variable | Value |
|---|---|
DISCORD_BOT_TOKEN |
Discord bot token |
CLIENT_ID |
Discord Application ID |
PUBLIC_KEY |
Discord Public Key |
PORT |
HTTP port (default: 3000) |
- Go to your Discord Developer Portal → General Information.
- Set Interactions Endpoint URL to your app URL:
https://your-app.example.com/interactions - Save. Discord will verify the endpoint.
npm run dev # starts server with hot reload
npm start # production startSlash commands are registered automatically on startup.
The bot runs anywhere that supports Node.js. A Dockerfile is included for containerized deployment.
- Create a new project in Railway.
- Deploy from your GitHub repository.
- Set the environment variables listed above.
- Set the interactions endpoint URL in Discord Developer Portal.
npm run dev # starts server with hot reload
npm test # run tests
npm run lint # lint
npm run format # format codeISC License 2024 ShibbityShwab