This is a simple script that will archive all messages from a Discord channel into a folder. It will create a folder for each channel and save all their messages in that folder. It will also save all attachments and embeds.
Warning: Two channels with the same name will overwrite each other.
This bot is not meant to be run public. It will save the files in the host's file system. It is meant to be run locally or on a private cloud.
- Install Python 3.8 or higher
- Install the requirements with
pip install -r requirements.txt
- Create a Discord bot and generate a token
- Rename
example.env
to.env
and fill in the token - Run the bot with
python bot.py
- Invite the bot to your server
- Give it the permission to read messages and history from the channels you want to archive. Or simply give it administrator permissions
- Run the command
!scrape
in the channel you want to archive - Wait until the bot is done, you'll see a message in the channel when it's done. It may take from some minutes to several hours depending on the ammount of messages in the channel, the size of the attachments and the speed of your internet connection.
- The files will be saved in the folder with the same name as the channel. These are located in the root folder of the bot.