A Discord bot that makes and stores an archive of every message sent in a Discord text channel.
- Python 3.12
- A Discord Developer Portal Account
Basic Python and Discord bot knowledge may be required for setup.
- Download this repo (big green button "code", download zip). Unzip the folder, open it, and open a terminal in that folder (right click+open terminal on Windows)
- Install Discord Python library:
pip install discord.py
- Discord bot setup: go to the Discord Developer Portal, and create a new application. Click on "Bot," then "Bot permissions." Check "Administrator." Scroll up and reset token, then save it somewhere.
- Enter the Discord bot token at the bottom of the bot.py script.
- Invite the bot to your server in the Discord Developer portal - Go to your bot, click "installations," and check "Bot" and "Administrator." Copy the invite link to your browser and select the server you want to invite it to.
- Send the message "!archive" in the text channel you want to archive.
- The folder with the bot now has a subfolder called "message_archive" with the archived content.
- Issues when saving multiple attachments with the same filename
- Doesn't archive attachments with really long/invalid character filenames
- This bot requires Administrator on your Discord server. This is a dangerous permission to give out. I am not doing anything malicious, but please check my code for yourself, don't take my word for it.
- Do not use this bot for malicious purposes, and only archive a server with the server member's consent.