https://github.com/alyetama/discord-backup-bot
A Discord bot to back up your server messages data with one command
https://github.com/alyetama/discord-backup-bot
backup bot discord export messages-backup python
Last synced: 3 months ago
JSON representation
A Discord bot to back up your server messages data with one command
- Host: GitHub
- URL: https://github.com/alyetama/discord-backup-bot
- Owner: Alyetama
- License: mit
- Created: 2022-07-05T05:00:58.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-07T03:04:25.000Z (almost 4 years ago)
- Last Synced: 2025-07-23T07:31:59.624Z (11 months ago)
- Topics: backup, bot, discord, export, messages-backup, python
- Language: Python
- Homepage: https://alyetama.github.io/Discord-Backup-Bot/
- Size: 53.7 KB
- Stars: 10
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Discord Backup Bot
🚀 A Discord bot to automatically back up your server messages data[^1]
[](https://www.python.org/downloads/) [](https://www.python.org/dev/peps/pep-0008/) [](https://www.python.org/dev/peps/pep-0008/) [](https://github.com/Alyetama/Discord-Backup-Bot/blob/main/LICENSE)
[](https://github.com/Alyetama/Discord-Backup-Bot/actions/workflows/docker-build.yml) [](https://hub.docker.com/r/alyetama/discord-backup-bot)
[](https://discord.com/api/oauth2/authorize?client_id=993789756955705375&permissions=117760&scope=bot)
## Commands
- To backup all channels:
> !backup all
- To back up a specific channel, you can use:
a. The channel ID:
> !backup 992974919547756566
b. or the channel mention:
> !backup #general
## Required Permissions
### Bot
`Read Messages`, `Send Messages`, `Embed Links`, `Attach Files`, `Read Message History`.
### User
Only members with `Administrator` permission can use the bot.
---
## Self-Hosting & Development
### Requirements
- 🐍 [python>=3.6](https://www.python.org/downloads/)
### ⬇️ Installation
```sh
git clone https://github.com/Alyetama/auto-discord-server-backup.git
cd auto-discord-server-backup
pip install -r requirements.txt && rm -rf src
```
### ⌨️ Usage
- Rename `.env.example` to `.env`, then edit it with your favorite text editor to add your bot token.
- Then, run:
```sh
python bot.py
```
### 🐳 Docker
```sh
docker run -d -e BOT_TOKEN="xxxxxxxxxxxxx" alyetama/discord-backup-bot:latest
```
### 🔧 Advanced (Docker-Compose)
Optional: You can use the Docker-Compose file to host the bot, a self-hosted S3-compatible Object Storage to upload the backup data ([MinIO](https://github.com/minio/minio)), and a URL shortner to shorten the presigned URLs ([Polr](https://github.com/cydrobolt/polr)).\
First, uncomment and set the optional environment variables in the `.env` file, Then, run:
```sh
docker-compose up -d
```
[^1]: ⚠️ The backup files are meant for archival purposes. You **cannot** restore your server using the backup files.