A command-line tool for autonomously uploading files to Discord.
Payload is a powerful Discord Bot designed to simplify the process of uploading files to your Discord channels. Whether you need to upload a large batch of files or just one, Payload ensures smooth uploads, progress tracking, and handles potential issues like file size limits. It's designed to be user-friendly, guiding you through the upload process with clear prompts.
You'll need to install the dependencies if you haven't already. You'll also need to set up the Discord Bot token:
-
Prerequisites:
- Node.js (version 18.20.6)
- npm (comes with Node.js)
- inquirer (version 8.0.0)
- A Discord Bot Token (you'll create one through the Discord Developer Portal - see Setup)
-
Installing Dependencies:
- If you've downloaded the files (e.g., from GitHub or Discord), navigate into the project directory in your terminal.
- Run the command:
npm installThis will install all necessary dependencies defined inpackage.json. - run the command:
npm install inquirer@8.0.0This will install inquirer into the proejct directory
-
Creating an Executable (Optional):
- To create an executable for easier running (no need for command-line
nodecalls):- Install
pkgglobally:npm install -g pkg - Run
pkg .(orpkg . --targets node16-win-x64,node16-linux-x64,node16-macos-x64for cross-platform executables). This will create an executable in the project root directory.
- Install
- To create an executable for easier running (no need for command-line
-
Setup & Configuration:
- Create a Discord Bot:
- Go to the Discord Developer Portal.
- Create a new application.
- In the "Bot" section, add a bot to your application.
- Copy your bot's token. Keep this token secret!
- Configure the Bot Token:
-
Payload uses a
config.jsonfile to store your bot token. -
Locate the
config.jsonfile in the project. (If it does not exist, create one in the root directory). -
Paste your bot token into the
tokenfield:{ "token": "YOUR_BOT_TOKEN_HERE" }Replace
YOUR_BOT_TOKEN_HEREwith your actual bot token.
-
- Invite Your Bot:
- In the Discord Developer Portal, go to "OAuth2" -> "URL Generator."
- Select the "bot" scope and grant it the "Send Messages" permission (and any other required permissions).
- Copy the generated URL and paste it into your browser.
- Select the server where you want your bot to be active and authorize the bot.
- Create a Discord Bot:
-
Running from command line:
- Navigate to the project directory in your terminal.
- Run the command:
node payload.js
-
Running the executable:
- Navigate to the directory where the executable was created (e.g., the project root).
- Run the executable by double-clicking it (if on Windows, or if you've configured the OS to execute it).
- Or run the executable from the command line (e.g.,
./payloadon Linux/macOS orpayload.exeon Windows).
-
Follow the Prompts: Payload will guide you through the upload process.
- Username: The username in discord
- Folder Location: Paste the path to the folder containing the files you want to upload.
- Channel ID: Paste the ID of the Discord channel where you want to upload the files. You can find the channel ID by enabling Developer Mode in Discord (Settings -> Advanced) and right-clicking the channel to copy the ID.
- Server Size: Select the server size from the prompt.
-
Upload: Payload will begin uploading the files, displaying progress information in the terminal.
- discord.js - Library for interacting with the Discord API.
- node-fetch - For making HTTP requests.
- fs - For file system operations.
- path - For manipulating file paths.
- readline-sync - For getting user input.
- pkg - For creating executables
Contributions are welcome! You can contribute in the following ways:
- GitHub: Open issues to report bugs, suggest features, or request improvements. Submit pull requests with code changes.
- Discord: Engage in discussions and share ideas in the forum section of my Discord server (Discord link: https://discord.gg/gAuz5Y8rVZ).
This project is licensed under the MIT License.
For questions or support, contact VladF4 on Discord.