Skip to content

devAxri/Discord-Server-Exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord-Server-Exporter

A simple Discord bot that backs up text channel messages and attachments from a server into local files.

The bot creates a timestamped backup folder, saves each text channel’s messages into a messages.txt file, and downloads attachments into a dedicated attachments folder.

Features

  • Usable as a Docker container
  • Backs up all text channels in a Discord server
  • Saves messages in chronological order
  • Downloads message attachments
  • Organizes backups by timestamp and channel
  • Logs errors to a traceback file
  • Sends a backup-start notification to a configured announcement channel
  • Automatically shuts down after the backup finishes

Backup Structure

Each run creates a new folder inside backups/ using the current date and time.

backups/
└── 2026-05-23_14-30-10/
    ├── 123456789012345678_general/
    │   ├── messages.txt
    │   └── attachments/
    │       └── 987654321098765432_image.png
    └── 234567890123456789_announcements/
        ├── messages.txt
        └── attachments/

Each messages.txt file follows this format:

[time] author_name (author_id): message

[2026-05-23 14:25:01] ExampleUser (123456789): Hello world!
    [attachment saved] backups/...

Security

Never commit your bot token or share it publicly.

Usage

Run the bot directly with Python:

python main.py

I personally run it with Docker like this:

docker build -t chat-exporter .
docker run -v "$(pwd)/backups:/backups" chat-exporter

The Docker command mounts your local backups/ folder into the container so backups are saved outside the container and remain available after it exits.

Todo

  • Sanitization for Windows-based systems.

License

This project is provided as-is. You may modify and use it for your own Discord servers.

About

Bot that backs up complete Discord servers, runable as a Docker container.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors