A Discord bot that automatically synchronizes bans between multiple Discord servers, ensuring consistent moderation across your server network.
- ⚡ Real-time ban updates across your Discord servers
- 🔒 Secure and reliable ban management
- 🛠️ Easy setup and configuration
Before you begin, ensure you have the following installed:
- Git
- Node.js (v24.1.0 or higher)
- pnpm (v10.11.0 or higher)
- Docker (optional, for containerized deployment)
- PM2 (optional, for process management)
This assumes you already have Corepack enabled on your system. If you don't, you can enable it using corepack enable,
as it comes preinstalled with Node.js.
git clone [email protected]:almeidx/discord-ban-sync.git
cd discord-ban-sync- Copy the example environment file:
cp .env.example .env- Configure your environment variables in the
.envfile
| Variable | Description | Example | Required |
|---|---|---|---|
DISCORD_TOKEN |
Your Discord bot token | your-bot-token-here |
Yes |
GUILD_IDS |
Comma/Newline-separated list of server IDs | 123456789012345678,123456789012345678 |
Yes |
DELETE_MESSAGE_SECONDS |
Amount of seconds of messages to delete from users when banning (0-604800) | 604800 (7 days) |
No |
The easiest way to run the bot is using Docker. You have two options:
- Copy the example environment file:
cp .env.example .env-
Configure your environment variables in the
.envfile -
Start the bot:
docker compose up -d- View logs:
docker compose logs -f- Stop the bot:
docker compose down- Pull the latest image:
docker pull ghcr.io/almeidx/discord-ban-sync:latest- Run the container with environment variables:
docker run -d \
--name discord-ban-sync \
-e DISCORD_TOKEN=your-bot-token-here \
-e GUILD_IDS=123456789012345678,987654321098765432 \
-e DELETE_MESSAGE_SECONDS=604800 \ # Optional
ghcr.io/almeidx/discord-ban-sync:latest- View logs:
docker logs -f discord-ban-sync- Stop the container:
docker stop discord-ban-sync
docker rm discord-ban-syncFirst off, setup the environment:
If you don't have Corepack enabled, you can do it using corepack enable, as it comes preinstall with Node.js.
corepack install
pnpm install --frozen-lockfilenode --run startpm2 start ecosystem.config.cjsTo verify the bot is working, use the /ping slash command in your Discord server.
To update the bot to the latest version:
git pull --rebase
pnpm install --frozen-lockfileThen restart the bot using your preferred method (local, Docker, or PM2).
discord-ban-sync © almeidx, released under the Apache 2.0 license.
GitHub @almeidx