This is a Python-based Discord bot designed to facilitate large file transfers by breaking them into smaller chunks and sending them via Discord channels. It also includes a command-line interface for easy interaction.
- Large File Uploads: Upload files of virtually any size by splitting them into 10MB chunks. ⬆️📁
- File Downloads: Download files that were uploaded using the bot. ⬇️💾
- Compression: Files are compressed using LZMA before uploading to reduce transfer size. 📦💨
- User-Friendly CLI: An interactive command-line interface for choosing between upload and download operations. 🖥️💬
- Progress Animation: Visual feedback during file operations. 📊⏳
Before you begin, ensure you have the following installed:
- Python 3.8+ 🐍
discord.pylibrary 🤖pystylelibrary 🎨requestslibrary 🌐lzma(usually built-in with Python) 🗜️tkinter(usually built-in with Python for file dialogs) 🖼️
You can install the required Python libraries using pip:
pip install discord.py pystyle requests-
Create a Discord Bot: ➕🤖
- Go to the Discord Developer Portal.
- Click "New Application" and give your bot a name.
- Navigate to the "Bot" tab, click "Add Bot", and confirm.
- Crucially, enable the "Message Content Intent" and "Guilds Intent" under the "Privileged Gateway Intents" section. ✅
- Copy your bot's token. 📋
-
Add the Bot to Your Server: 🤝
- Go to the "OAuth2" -> "URL Generator" tab.
- Select
botunder "Scopes". - Under "Bot Permissions", select
Send Messages,Manage Channels, andManage Messages(for pinning). - Copy the generated URL and paste it into your browser to invite the bot to your server. 🔗
-
Configure
main.py: ✏️- Open
main.py. - Replace
"YOUR_BOT_TOKEN_HERE"with your actual Discord bot token:bot.run("YOUR_BOT_TOKEN_HERE") # Replace with your token
- Identify a Discord Guild (server) ID and a channel ID within that guild where the bot will create new channels for file transfers and send initial connection messages. Replace
LOG_CHANNEL_IDandGUILD_IDwith your actual IDs:await bot.get_channel(LOG_CHANNEL_ID).send("connected new user!") # Your channel ID for connection messages # ... channel = await bot.get_guild(GUILD_ID).create_text_channel(name) # Your guild ID for creating channels
- Open
To run the bot, simply execute main.py:
python main.pyThe bot will connect to Discord, and you will be presented with a menu:
__ _ _ _ _ _ _
/ /(_) __ _| |__ | |_ _ __ (_)_ __ __ _ /\ /\ _ __ | | ___ __ _ __| | ___ _ __
/ / | |/ _` | '_ \| __| '_ \| | '_ \ / _` | / / \ | '_ \| |/ _ \ / _` |/ _ | '__|
/ /__| | (_| | | | | |_| | | | | | | | (_| | \ \_/ | |_) | | (_) | (_| | (_| | __| |
\____|_|\__, |_| |_|\__|_| |_|_|_| |_|\__, | \___/| .__/|_|\___/ \__,_|\__,_|\___|_|
|___/ |___/ |_|
Version 1.1
Made with bambi by dogo <3
Click ctrl+c to go back!
|[1] Download
|[2] Upload
Select option:
- Select option
2(Upload). - A file dialog will open. Choose the file you wish to upload. 📂
- The bot will compress the file, split it into chunks, and upload each chunk to a newly created Discord text channel. ➡️ Discord
- Once complete, a link to a JSON file containing the URLs of all parts will be provided in the console. Share this link for others to download the file. 🔗
- Select option
1(Download). - Enter the JSON link provided after an upload operation. ➡️
- The bot will download all parts, decompress them, and reconstruct the original file in the same directory where
main.pyis run. ⬇️💾
main.py: The main script that handles bot initialization, user interaction, file uploading, and downloading. 🚀logger.py: Contains utility classes and functions for a custom menu, animation, and colored console output. 📝✨
- Bot Token Security: Keep your bot token private. Do not share it publicly. 🔒
- Discord Rate Limits: Be mindful of Discord's API rate limits. This bot attempts to handle large files by chunking, but excessive rapid operations might still trigger rate limits. ⏱️
- Channel Management: The bot creates new channels for each upload. You may want to periodically clean up these channels. 🧹
- File Size: While theoretically unlimited, extremely large files might take a significant amount of time to upload/download and consume considerable bandwidth. 🐢
- Improve Memory Management: Optimize memory usage, especially when handling very large files, to prevent excessive RAM consumption. 🧠💡
- Add error handling for network issues during file transfers. 🚫🌐
- Implement a more robust way to manage Discord channels created by the bot (e.g., automatic deletion after a certain time). 🗑️
- Consider adding a progress bar within Discord itself for better user feedback. 📈
- Explore options for resuming interrupted downloads. ↩️
Feel free to fork this repository, open issues, or submit pull requests to improve the bot.
This project is open-source and available under the MIT License.