Skip to content

Alyetama/Discord-Backup-Bot

Repository files navigation

Discord Backup Bot

🚀 A Discord bot to automatically back up your server messages data1

Supported Python versions PEP8 Discord.py GitHub License

Docker Build Docker Hub

Discord

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

⬇️ Installation

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:
python bot.py

🐳 Docker

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), and a URL shortner to shorten the presigned URLs (Polr).
First, uncomment and set the optional environment variables in the .env file, Then, run:

docker-compose up -d

Footnotes

  1. ⚠️ The backup files are meant for archival purposes. You cannot restore your server using the backup files.