A simple Python Discord bot for creating and restoring server structure backups.
/backup create— create a backup/backup list— list backups/backup restore— restore a backup/backup delete— delete a backup- Backs up roles, permissions and positions
- Backs up categories and channels
- Backs up channel permission overwrites
- Backs up text, announcement, voice, stage and forum channel settings where supported
- Backs up custom emojis and downloads their assets
- Saves backups as readable JSON files
- Restore is additive by default and does not delete existing channels or roles
Discord does not provide a normal bot API for restoring old message history, so messages are not included.
Server ownership and other Discord-managed resources cannot be recreated by a bot. Managed/integration roles are skipped.
The bot needs enough permissions to create/edit the resources it is restoring. Administrator is recommended for a simple setup.
Python 3.10 or newer is recommended.
pip install -r requirements.txtCreate an application in the Discord Developer Portal, create a bot, and copy its token.
Invite it to your server with the permissions it needs. Administrator is the simplest option for testing.
Copy .env.example to .env:
DISCORD_TOKEN=your_token
GUILD_ID=your_server_id
BACKUP_DIR=./backups
Never upload .env to GitHub.
python bot/main.pyThe bot registers the /backup command to the configured GUILD_ID.
/backup create
/backup create name:my-backup
/backup list
/backup restore name:my-backup
/backup delete name:my-backup
Only members with Administrator permission can use these commands.
Each backup is stored as JSON in backups/. Downloaded emoji assets are stored in a matching *-assets folder.
Made By @jveu