Discord Bot CDN is a Node.js program that allows you to store files (25mb limit per file) using Discord's CDN and a Discord bot. It works by having a web server that allows file uploads, which then get uploaded by a bot to the Discord CDN. The CDN links get shortened using a base26 encoding (all letters from a to z).
- Create a bot using the Discord Developer Portal.
- (recommended) Create a new Discord server.
- Create a channel in said Discord server.
- Clone the repository.
- Run
npm install
to install the necessary packages. - Create a
.env
file with the following keys:UPLOAD_PASSWORD
: An upload password to prevent abuse.DISCORD_BOT_TOKEN
: Your bot token.DISCORD_CHANNEL_ID
: The channel ID of the channel.RETURN_ORIGINAL_URL
: set tofalse
if you want to get the original Discord CDN URL.
- Run
node index.js
to start the program.
- A user uploads a file to the web server.
- The web server checks the password and file size limit.
- The file is uploaded to Discord's CDN using the Discord API and a bot token.
- The bot retrieves the CDN URL and encodes it using base26.
- The encoded URL is returned to the user.
- User visits the web server.
- User enters the upload password.
- User selects a file to upload.
- The file is uploaded and a shortened URL is returned to the user.
- The user shares the shortened URL with others to access the file.
Discord Bot CDN is a simple and efficient way to store and share files up to 25mb using Discord's CDN and a Discord bot. With this CDN, you can easily upload and share files with your friends and community without having to worry about storage limits. Use the steps above to install and start using Discord Bot CDN today!