A Discord moderation bot for managing moderation actions across a primary server and approved affiliated servers.
This bot is intended for use by a controlled network of approved servers. It is not intended to be a general-purpose public moderation bot.
- Kick users from the primary server only
- Ban users across configured synced servers
- Temporary bans across configured synced servers
- Unban users across configured synced servers
- Timeout / mute users across configured synced servers
- Remove timeouts / unmute users across configured synced servers
- Sync current primary-server bans to one specified affiliate server
- Tempban-aware ban syncing
- Moderation action logs
- Message, role, user, invite, join/leave, VC, and server-management logs
- Warn system
- User info command
- Giveaway command with button-based entry and automatic winner selection, with a customizable title, description, button label, entry emoji (unicode or server custom emoji), and embed accent color
- Channel lockdown / unlock commands with per-channel targeting and role whitelisting
- Join guard / account age protection
- Runtime affiliate management commands for bot owners
- Optional ticket system with category dropdowns, close/archive flow, transcripts, and media logs
- Optional nation selector with Minecraft account registration, Bedrock/Geyser support, and rejoin role restore
- Role-based command permissions
- Owner-only bot management commands
The .env file only needs:
DISCORD_TOKENBOT_OWNER_IDS
All other bot settings are stored in data/moderation.sqlite3 and managed through owner-only slash commands such as /config_set, /config_id_add, /config_id_remove, /config_get, and /config_list.
To enable tickets, set ENABLE_TICKETS to true and restart the bot. Then configure:
TICKET_LOG_CHANNEL_IDfor archived.txttranscriptsTICKET_IMAGE_LOG_CHANNEL_IDfor forwarded ticket mediaTICKET_CLOSED_CATEGORY_IDfor closed ticket channelsTICKET_REPORT_PING_ROLE_ID,TICKET_ADMIN_PING_ROLE_ID,TICKET_DISPUTE_PING_ROLE_ID,TICKET_CUSTOM_ROLE_PING_ROLE_ID,TICKET_AFFILIATE_PING_ROLE_ID, andTICKET_OTHER_PING_ROLE_IDfor category-specific pings
Use /ticket_panel in a text channel inside the Discord category where open tickets should be created.
To enable the nation selector, set ENABLE_NATION_SELECTOR to true and restart the bot. Then configure:
WHITELISTED_ROLE_IDfor the role granted after Minecraft account registrationPLAINS_ROLE_ID,FOREST_ROLE_ID,DESERT_ROLE_ID,TAIGA_ROLE_ID,JUNGLE_ROLE_ID,DARK_FOREST_ROLE_ID,MESA_ROLE_ID,SNOW_ROLE_ID,MUSHROOM_ISLAND_ROLE_ID,SAVANNA_ROLE_ID,SWAMP_ROLE_ID, andCHERRY_ROLE_IDfor the 12 nation rolesMS_CLIENT_ID,MS_CLIENT_SECRET, andMS_REDIRECT_URIin.envfor Microsoft OAuth registrationNATION_SELECTOR_LOG_THREAD_IDfor optional selector logs
Register the Microsoft OAuth app for personal Microsoft accounts, add a web redirect URI that exactly matches MS_REDIRECT_URI, and make that URL route to this bot's NATION_OAUTH_PORT.
Java profile verification uses Minecraft Java game service APIs; new third-party integrations may need Mojang review/allowlist access. If Java linking fails with Invalid app registration, the Microsoft app needs Mojang approval before it can use those Java APIs.
Use /nation_panel to send the registration button. Users choose Java or Bedrock/Geyser before Microsoft sign-in, and the callback links only the selected account type. Nation assignment is not shown or applied until after Microsoft verification succeeds. If a user starts sign-in and needs to retry, they can press Reset Authentication on the sign-in message instead of waiting for the link to expire. Members with administrator permission still verify and save their Minecraft account, but they are stored with no nation assignment and only receive the whitelisted role. Primary-server administrators can use /nation_manual_java to manually register a Java UUID without OAuth, /nation_change to change a registered user's nation, and /nation_reset to remove a user from the nation database.
For live read-only whitelist access from another server, set WHITELIST_EXPORT_TOKEN in .env and optionally WHITELIST_EXPORT_PATH (default /api/whitelist). The external server can pull current registrations with:
curl -H "Authorization: Bearer $WHITELIST_EXPORT_TOKEN" https://auth.insmp.org/api/whitelistCreate a .env file with DISCORD_TOKEN and BOT_OWNER_IDS, then run:
docker compose up -d --buildThe Compose service mounts ./data into the container, so data/moderation.sqlite3 persists across rebuilds and restarts.
Useful deployment commands:
docker compose logs -f
docker compose restart
docker compose downThe bot applies major moderation actions across configured synced servers. This keeps bans, tempbans, unbans, and timeouts consistent between the primary server and approved affiliated servers.
The syncbans command copies current primary-server bans to one specified affiliate server at a time.