A lightweight Discord bot that automatically crossposts messages in Announcement channels.
Built with:
- Node.js
- discord.js v14
- MongoDB (Mongoose)
- 🔄 Automatically publishes new messages in announcement channels
- 🎛 Enable/disable auto-publish per server
- 📋 Channel whitelist support
- 📊 View current whitelisted channels
- 🧠 MongoDB-backed persistent configuration
- ⚡ Optimized for low-resource hosting (256MB environments supported)
/autopublish toggle state:true
/autopublish toggle state:false
/autopublish channel target:#announcements action:add
/autopublish channel target:#announcements action:remove
/autopublish list
- If whitelist is empty → bot publishes in all announcement channels.
- If whitelist contains channels → bot publishes only in those channels.
- Discord rate limit: 10 publishes per hour per channel (handled automatically).
git clone https://github.com/YOUR_USERNAME/discord-autopublish-bot.git
cd discord-autopublish-botnpm installDISCORD_TOKEN=your_bot_token
CLIENT_ID=your_application_id
MONGO_URI=your_mongodb_connection_string
node deploy-commands.jsnpm startDesigned to run as a background Node process.
Recommended:
- 256MB RAM minimum
- Persistent WebSocket support
- No HTTP server required
Works on:
- VPS
- Docker
- Container-based hosts
- Lightweight free-tier platforms
For announcement channels:
- View Channel
- Send Messages
- Manage Messages
Channel must be of type:
Announcement Channel
src/
commands/
events/
models/
index.js
deploy-commands.js
- Skipped messages (due to rate limit or downtime) are not retroactively published.
- Discord enforces publish limits.
- Slash command changes require re-running
deploy-commands.js.
