Discord-Based Cloud Storage Solution
Transform your Discord server into a secure cloud storage backend with automatic compression, segmentation, and intelligent file management.
Documentation β’ Quick Start β’ Examples β’ API Docs β’ Changelog
- Overview
- Quick Start
- Features
- Prerequisites
- Installation
- Configuration
- Usage
- API Documentation
- Project Structure
- Scripts & Commands
- Troubleshooting
- Development
- FAQ
DCloud is an innovative cloud storage solution that leverages Discord servers as a secure backend for file storage. It automatically compresses files into 8MB segments using 7-Zip (LZMA2), uploads them to Discord forum channels via a dedicated bot, and maintains metadata for easy retrieval and restoration.
Local File/Folder
β
Compression (LZMA2)
β
Segmentation (8MB chunks)
β
Upload to Discord Bot
β
Store in Forum Threads
β
Metadata Tracking (JSON)
DCloud acts as a bridge between your local file system and Discord servers, enabling:
- ποΈ Compression: Automatic file/folder compression using LZMA2 algorithm with 512MB dictionary
- βοΈ Segmentation: Intelligent splitting of large files into manageable 8MB parts
- π€ Upload: Fully automated uploading to Discord forum threads via bot
- π₯ Retrieval: Seamless download and restore with automatic cleanup
- π Metadata: JSON-based tracking for file integrity and recovery
npm install discord-dcloudgit clone https://github.com/NeelFrostrain/DCloud.git
cd DCloud
npm install- Create a Discord bot at Discord Developer Portal
- Get your bot token, server ID, and forum channel ID
- Add bot to your server with proper permissions
Edit src/index.ts:
const TOKEN = "YOUR_BOT_TOKEN";
const CHANNEL_ID = "YOUR_FORUM_CHANNEL_ID";
const GUILD_ID = "YOUR_SERVER_ID";# Development mode (with auto-reload)
npm run dev
# Or production mode
npm run build && npm start| Feature | Description |
|---|---|
| ποΈ Advanced Compression | LZMA2 algorithm with 512MB dictionary for maximum compression |
| βοΈ Smart Segmentation | Automatic 8MB chunking for Discord compatibility |
| π€ Discord Bot Integration | Full Discord.js v14 support with forum thread management |
| π Metadata Tracking | JSON-based metadata for file integrity and recovery |
| β‘ Concurrent Uploads | Parallel upload handling for optimal performance |
| π₯ Full Restoration | Complete download and extraction pipeline |
| β TypeScript | Fully typed codebase with strict type checking |
| π¨ Rich Logging | Color-coded console output with Chalk |
| π‘οΈ Error Handling | Comprehensive error management and recovery |
| π¦ Production Ready | Optimized for production use with proper cleanup |
| Requirement | Version | Note |
|---|---|---|
| Node.js | β₯ 18.0.0 | Runtime environment |
| npm | β₯ 9.0.0 | Package manager |
| TypeScript | β₯ 5.0 | Peer dependency (required for development) |
| Disk Space | 500MB+ | For temporary files during compression |
| RAM | 2GB minimum | 4GB+ recommended |
- Discord Server: Admin access to create forum channels
- Discord Bot: Valid bot token with proper permissions
- 7-Zip: Bundled via
7zip-binpackage (auto-installed)
Your bot requires these permissions:
PERMISSIONS NEEDED:
β Send Messages
β Create Public Threads
β Send Messages in Threads
β Embed Links
β Attach Files
β Read Message History
| OS | Status | Notes |
|---|---|---|
| Windows | β Fully Supported | Recommended |
| macOS | β Fully Supported | Requires p7zip-full |
| Linux | β Fully Supported | Install: sudo apt-get install p7zip-full |
git clone https://github.com/NeelFrostrain/DCloud.git
cd DCloudnpm installThis installs:
- discord.js v14.25.1 - Discord bot framework
- 7zip-bin v5.2.0 - 7-Zip binary
- chalk v5.6.2 - Terminal styling
- Dev Tools - ESLint, TypeScript, Nodemon
# Check TypeScript compilation
npm run type-check
# Lint code
npm run lint
# Try building
npm run buildStep 4: Configuration (See Configuration Section)
- Go to Discord Developer Portal
- Click "New Application"
- Enter name:
DCloud Bot(or your preference) - Accept Terms and Create
- Navigate to "Bot" section
- Click "Add Bot"
- Click "Reset Token" to copy bot token
β οΈ Keep this token secret! Never commit to git
- Go to "OAuth2" β "URL Generator"
- Select Scopes:
bot - Select Permissions:
- β Send Messages
- β Create Public Threads
- β Send Messages in Threads
- β Embed Links
- β Attach Files
- β Read Message History
- Copy the generated URL
- Open the OAuth2 URL in your browser
- Select your Discord server
- Click "Authorize"
- Complete the CAPTCHA
Method 1: Developer Mode (Easiest)
- Open Discord User Settings β Advanced
- Enable "Developer Mode"
- Right-click server name β "Copy Server ID" (Server ID)
- Right-click forum channel β "Copy Channel ID" (Forum Channel ID)
Method 2: Discord API Use Discord Server Info Bot or similar
Edit src/index.ts:
import { DCloud } from "./classes/dCloud";
const TOKEN = "MTQxODYyMjg0MDE4NTQyMTgzNg..."; // Bot token
const CHANNEL_ID = "1465235994243502162"; // Forum channel ID
const GUILD_ID = "1316439358609297418"; // Server ID
const dCloud = DCloud({
FORUM_CHANNEL_ID: CHANNEL_ID,
TOKEN: TOKEN,
SERVER_ID: GUILD_ID,
});
await dCloud.init();Create .env file:
DISCORD_TOKEN=YOUR_BOT_TOKEN
DISCORD_SERVER_ID=YOUR_SERVER_ID
DISCORD_FORUM_CHANNEL_ID=YOUR_FORUM_CHANNEL_IDUpdate src/index.ts:
import dotenv from "dotenv";
dotenv.config();
const dCloud = DCloud({
TOKEN: process.env.DISCORD_TOKEN!,
SERVER_ID: process.env.DISCORD_SERVER_ID!,
FORUM_CHANNEL_ID: process.env.DISCORD_FORUM_CHANNEL_ID!,
});Test your configuration:
npm run devExpected output:
[Bot] [Status]: Logged in as DCloud#1234
[Bot] [Guild]: Connected to Server: MyServer
[Bot] [Channel]: Target Forum: #uploads
If you see errors, review the Troubleshooting section.
import { DCloud } from "@discord/dcloud";
const dCloud = DCloud({
FORUM_CHANNEL_ID: "1465235994243502162",
TOKEN: "YOUR_BOT_TOKEN",
SERVER_ID: "1316439358609297418",
});
// Initialize the bot
await dCloud.init();
// Upload a file
const result = await dCloud.upload("C:\\path\\to\\file.zip");
console.log("Upload complete:", result);import { DCloud } from "./src/classes/dCloud";
const dCloud = DCloud({
FORUM_CHANNEL_ID: "1465235994243502162",
TOKEN: "YOUR_BOT_TOKEN",
SERVER_ID: "1316439358609297418",
});
// Initialize the bot
await dCloud.init();
// Upload a file
const result = await dCloud.upload("C:\\path\\to\\file.zip");
console.log("Upload complete:", result);// Download using metadata URL
await dCloud.downloader(
"https://cdn.discordapp.com/attachments/.../metadata.json",
"C:\\output\\path",
);
console.log("Download and extraction complete!");npm run devWatches for file changes and automatically restarts.
npm run build
npm startCompiles TypeScript to JavaScript and runs it.
npm run type-checkValidates TypeScript without emitting files.
Main class for file upload/download operations.
DCloud(config: ICloudBot): DCloudClassParameters:
config.TOKEN: Discord bot token (string)config.SERVER_ID: Discord guild/server ID (string)config.FORUM_CHANNEL_ID: Target forum channel ID (string)
Initializes the bot and connects to Discord.
await dCloud.init();Uploads a file or directory to Discord.
Parameters:
filePath: Absolute path to file or directory
Returns: Upload result with metadata URL
Example:
const result = await dCloud.upload("C:\\files\\mydata.zip");Process Flow:
- Validates input path
- Initializes Discord thread with file info
- Compresses file with LZMA2 (8MB segments)
- Uploads segments to Discord
- Generates and uploads metadata.json
- Cleans up temporary files
- Returns metadata URL
Downloads and restores files from Discord.
Parameters:
metadataUrl: URL to metadata.json fileoutputPath: Directory to save restored files
Example:
await dCloud.downloader(
"https://cdn.discordapp.com/attachments/.../metadata.json",
"C:\\restored\\",
);Process Flow:
- Fetches metadata.json
- Creates directory structure
- Downloads all archive segments
- Extracts using 7-Zip
- Cleans up temporary files
- Completes restoration
Handles Discord bot operations and thread management.
Initializes the Discord bot connection.
Checks if bot is connected and ready.
interface ICloudBot {
TOKEN: string; // Discord bot token
SERVER_ID: string; // Guild/server ID
FORUM_CHANNEL_ID: string; // Forum channel ID
}interface ICompressor {
originalName: string; // Original file/folder name
totalSize: string; // Size in MB
createdAt: string; // Creation timestamp
parts: {
name: string; // Segment filename
url: string; // Discord CDN URL
}[];
}interface ICompressorResult {
originalName: string; // Original file/folder name
totalSize: string; // Total size in MB
createdAt: string; // Creation timestamp
metadata: string; // Metadata.json URL
}DCloud/
βββ src/
β βββ classes/
β β βββ cloudBot.ts # Discord bot management
β β βββ dCloud.ts # Main upload/download logic
β βββ interface/
β β βββ index.ts # TypeScript interfaces
β βββ utils/
β β βββ 7zip.ts # 7-Zip compression utilities
β β βββ lib.ts # Helper functions
β βββ index.ts # Entry point & examples
βββ dist/ # Compiled JavaScript (auto-generated)
βββ node_modules/ # Dependencies (auto-generated)
βββ eslint.config.ts # ESLint rules
βββ tsconfig.json # TypeScript configuration
βββ package.json # Dependencies & npm scripts
βββ index.d.ts # Public API type definitions
βββ README.md # This documentation
| Directory | Purpose |
|---|---|
| src/ | TypeScript source code |
| src/classes/ | Core DCloud and CloudBot classes |
| src/interface/ | Type definitions and interfaces |
| src/utils/ | Utility functions (7-Zip, helpers) |
| dist/ | Compiled JavaScript output |
| Command | Purpose | Usage |
|---|---|---|
npm run dev |
Start with auto-reload | npm run dev |
npm run build |
Compile TypeScript | npm run build |
npm run type-check |
Check types without emit | npm run type-check |
npm run lint |
Run ESLint | npm run lint |
| Command | Purpose | Note |
|---|---|---|
npm start |
Build and run | Compiles and executes compiled code |
npm run build |
TypeScript compilation | Creates dist/ folder |
# Development workflow
npm install # Install dependencies
npm run dev # Start development server
# Before committing
npm run lint # Check code quality
npm run type-check # Verify types
# Production deployment
npm run build # Compile code
npm start # Run compiled versionThe project uses ESLint with TypeScript support:
npm run lintConfig file: eslint.config.ts
Verify types and compilation:
npm run type-check # Check types without emitting
npm run build # Full compilation to JavaScript- Write Code: Create TypeScript files in
src/ - Test Locally: Use
npm run devfor auto-reload testing - Validate: Run
npm run type-checkto check types - Lint: Run
npm run lintto check code quality - Build: Run
npm run buildto verify compilation - Test Complete Flow: Manually test upload/download
- Commit: Push changes once verified
Add interfaces to src/interface/index.ts:
export interface IMyFeature {
name: string;
value: number;
}Add functions to src/utils/:
export function myUtility(input: string): string {
return input.toUpperCase();
}Update classes in src/classes/:
public async myMethod(param: string): Promise<void> {
// Implementation
}Export in index.d.ts:
export { myUtility } from "./src/utils/lib";Problem: "Could not find server with ID"
Solution:
- Verify your
SERVER_IDis correct - Ensure the bot is invited to the server
- Check bot permissions in server settings
Problem: "Channel ID provided is not a Forum Channel"
Solution:
- Verify you're using a forum channel, not a regular channel
- Right-click the channel in Discord to confirm it's a forum
- Get the correct channel ID
Problem: "File not found at path"
Solution:
- Use absolute paths (e.g.,
C:\\Users\\...) - Verify the file exists before uploading
- Check file permissions (must be readable)
Problem: "Bot is not online"
Solution:
- Call
await dCloud.init()before uploading - Verify bot token is correct and still valid
- Check bot permissions in Discord server
Problem: "7-Zip binary not found"
Solutions:
- Reinstall dependencies:
npm install - Ensure
7zip-binpackage is properly installed - On Linux, install p7zip:
sudo apt-get install p7zip-full - On macOS:
brew install p7zip
Problem: "Input path does not exist"
Solutions:
- Verify file path is absolute and correct
- Check file permissions (must be readable)
- Use forward slashes or escaped backslashes in paths
Problem: "FATAL ERROR: CALL_AND_RETRY_LAST"
Solutions:
- Increase Node.js memory limit:
node --max-old-space-size=4096 dist/index.js
- Reduce file size being compressed
- Monitor system resources and close unnecessary applications
Problem: Slow uploads to Discord
Solutions:
- Check internet connection speed
- Add delays between uploads:
setTimeout(...) - Use exponential backoff for retries
- Consider uploading during off-peak hours
Problem: "429 Too Many Requests"
Causes: Discord API rate limiting (20 requests/sec per channel)
Solutions:
- Add delays between file uploads
- Implement exponential backoff retry logic:
let retries = 0; while (retries < 3) { try { await dCloud.upload(filePath); break; } catch (e) { await new Promise((r) => setTimeout(r, Math.pow(2, retries) * 1000)); retries++; } }
- Split uploads across multiple bot instances
| Metric | Value |
|---|---|
| Algorithm | LZMA2 with 512MB dictionary |
| Compression Ratio | 40-70% (file type dependent) |
| Speed | ~10-50 MB/min (CPU dependent) |
| Dictionary Size | 512MB (maximum) |
| Metric | Value |
|---|---|
| Discord Rate Limit | 20 requests/sec per channel |
| Typical Speed | 50-200 MB/hour |
| Segment Size | 8MB (safe margin below Discord limit) |
| Bottleneck | Discord API rate limiting |
| Category | Best For | Avoid |
|---|---|---|
| Text | Source code, logs, documents | Already compressed files |
| Media | High-quality images, uncompressed video | MP4, JPG, PNG (already compressed) |
| Archives | ZIP/RAR before uploading | Don't double-compress |
| Databases | Raw database files, backups | Encrypted archives |
- Poor for: Already compressed files (zip, mp4, jpg)
import { DCloud } from "./src/classes/dCloud.js";
import fs from "fs";
async function uploadExample() {
const dCloud = DCloud({
TOKEN: process.env.DISCORD_TOKEN || "YOUR_TOKEN",
SERVER_ID: process.env.DISCORD_SERVER_ID || "YOUR_SERVER_ID",
FORUM_CHANNEL_ID: process.env.DISCORD_FORUM_CHANNEL_ID || "YOUR_FORUM_ID",
});
try {
// Step 1: Initialize bot connection
console.log("π€ Initializing bot...");
await dCloud.init();
// Step 2: Upload file
console.log("π€ Starting upload...");
const result = await dCloud.upload("C:\\files\\backup.zip");
// Step 3: Display results
console.log("β
Upload successful!");
console.log(`π¦ Name: ${result.originalName}`);
console.log(`π Size: ${result.totalSize}`);
console.log(`π Metadata: ${result.metadata}`);
// Step 4: Save metadata URL for later
fs.writeFileSync("upload_metadata.json", JSON.stringify(result, null, 2));
console.log("πΎ Metadata saved to upload_metadata.json");
} catch (error) {
console.error("β Upload failed:", error);
}
}
uploadExample();import { DCloud } from "discord-dcloud";
async function downloadExample() {
const dCloud = DCloud({
TOKEN: process.env.DISCORD_TOKEN || "YOUR_TOKEN",
SERVER_ID: process.env.DISCORD_SERVER_ID || "YOUR_SERVER_ID",
FORUM_CHANNEL_ID: process.env.DISCORD_FORUM_CHANNEL_ID || "YOUR_FORUM_ID",
});
try {
// Step 1: Initialize bot
console.log("π€ Initializing bot...");
await dCloud.init();
// Step 2: Download and restore
console.log("π₯ Starting download...");
await dCloud.downloader(
"https://cdn.discordapp.com/attachments/.../metadata.json",
"C:\\restored\\",
);
console.log("β
Download and extraction complete!");
console.log("π Files restored to C:\\restored\\");
} catch (error) {
console.error("β Download failed:", error);
}
}
downloadExample();This project is marked as private. Please contact the author for licensing information.
Neel Frostrain (@NeelFrostrain)
- GitHub: NeelFrostrain
- Repository: DCloud
Contributions are welcome! Here's how to contribute:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
- Write in TypeScript
- Follow existing code style (use
npm run lint) - Test all changes locally
- Update documentation as needed
- Include meaningful commit messages
Q: Is my data safe on Discord?
A: Data is encrypted via Discord's HTTPS connections. However, Discord can theoretically access encrypted messages. For sensitive data, consider additional encryption.
Q: What's the maximum file size I can upload?
A: Theoretical limit depends on Discord storage. Each bot account can upload ~5GB before approaching limits. Use multiple bot accounts for larger backups.
Q: Can I use multiple bot instances?
A: Yes! You can scale horizontally by deploying multiple bot instances across different Discord servers.
Q: How long do uploaded files stay on Discord?
A: As long as the Discord message exists. Discord stores messages indefinitely unless deleted. Your responsibility is to maintain backup URLs.
Q: Can I use different compression algorithms?
A: Currently, LZMA2 is hardcoded. You can modify src/utils/7zip.ts to support other algorithms (PPMd, BZip2, etc.).
Q: How do I reduce upload time?
A: Options:
- Compress pre-upload (though files are already compressed)
- Use multiple bot instances
- Increase Discord API request limits if possible
- Optimize network connection
Q: Can I restore files partially?
A: No, the current implementation requires all segments. You must restore complete archives.
Q: Does DCloud support streaming uploads?
A: No, currently uses buffer-based uploads. Streaming support could be added as a future feature.
Q: Bot is not responding?
A: Check:
- Bot token is correct
- Bot is invited to server
- Forum channel exists and bot has access
- Internet connection is stable
Q: Uploads are very slow?
A: Causes and solutions:
- Network: Check internet speed
- CPU: Compression is CPU-intensive
- Discord Rate Limit: Add delays between uploads
- Large Files: Break into smaller chunks before uploading
Q: Can I cancel an upload in progress?
A: Not gracefully in the current version. You'd need to kill the process. Consider adding cancellation tokens in future versions.
β οΈ No partial restoration (must restore entire archives)β οΈ Single-threaded uploads (can be optimized)β οΈ No built-in encryption (Discord HTTPS provides some protection)β οΈ Metadata URLs may expire if Discord messages are deletedβ οΈ No support for incremental backups (only full backups)
Planned features for future versions:
- Incremental backup support
- Built-in encryption layer
- Progress tracking UI
- Scheduled automatic backups
- Multi-threaded uploads
- Compression algorithm selection
- WebUI dashboard
- REST API interface
- Check Troubleshooting section
- Review existing GitHub Issues
- Create a new issue with:
- Error message and logs
- Steps to reproduce
- System information (OS, Node.js version)
- DCloud version
When reporting bugs, include:
- Full error stack trace
- Console output
- File/folder being uploaded
- System specifications
Made with β€οΈ for the Discord community
Last Updated: January 27, 2026 Version: 0.1.0
To install dependencies:
npm installTo run:
npm start- Metadata File Attachments: Metadata now sent as
metadata.jsonfile attachment instead of message code blocks - Stream-Based Downloads: Improved memory efficiency for large file downloads
- Dual Metadata Support: Downloader handles both new file-based and legacy metadata formats
- Refactored upload method with improved error handling and logging
- Added
ensureFileReady()helper for reliable file status checking - Added
cleanupFolder()for non-blocking background cleanup - Improved 7zip compression parameters with precise byte values
- Better error messages and consistent formatting throughout codebase
- Removed
axiosdependency (migrated to native fetch API)
- Version Bump: 0.0.8 β 0.1.0
- Breaking Change:
initializeNewChannel()now requiresinputPathparameter - Dependencies Removed: axios and all transitive dependencies (axios, follow-redirects, form-data, etc.)
- Fixed metadata handling in downloader to match Restore() function requirements
- Improved file stability detection before upload
- Better error propagation in async flows
-
Metadata File Attachments: Metadata now sent as
metadata.jsonfile attachment instead of message code blocks- More reliable delivery
- Avoids Discord's 2000-character message limit
- Cleaner Discord interface
-
Stream-Based Downloads: Improved memory efficiency for large file downloads
- Lower RAM footprint
- Better performance on constrained systems
-
Dual Metadata Support: Downloader handles both new file-based and legacy metadata formats
- Seamless transitions between versions
- Backwards compatible
-
Refactored upload method with improved error handling and logging
-
Added
ensureFileReady()helper for reliable file status checking- Polls file every 250ms until stable
- Prevents uploading incomplete files
-
Added
cleanupFolder()for non-blocking background cleanup- 2-second delay to release file handles
- Doesn't block function returns
-
Improved 7zip compression parameters with precise byte values
- Changed from
-v8mto-v8388608(8MB in bytes) - More reliable segment sizing
- Changed from
-
Better error messages and consistent formatting throughout codebase
-
Removed
axiosdependency (migrated to native fetch API)- Package size reduced by ~50KB
- Fewer security vulnerabilities
-
initializeNewChannel()signature changed// Before initializeNewChannel(fileName: string) // After initializeNewChannel(fileName: string, inputPath: string)
Impact: Only if you called this method directly
Workaround: Use
upload()method instead (handles it internally)
axios- HTTP client (replaced with native fetch)follow-redirectsform-dataasynckitcombined-streammime-typesmime-db
- Fixed metadata handling in downloader to match Restore() function requirements
- Improved file stability detection before upload
- Better error propagation in async flows
| Metric | Value |
|---|---|
| Lines Added | 235 |
| Lines Removed | 151 |
| Net Change | +84 lines |
| Files Modified | 7 |
| Compilation Status | β No errors |
| Package Size Reduction | ~50KB |
Ensures 7zip has finished writing the file before upload.
private async ensureFileReady(filePath: string): Promise<void> {
// Polls every 250ms
// Waits for file size stability (2 consecutive equal sizes)
// Minimum file size: > 0 bytes
}Purpose: Prevent uploading incomplete files
Polling Interval: 250ms
Stability Threshold: 2 consecutive equal file sizes
Removes temporary files without blocking return.
private async cleanupFolder(folderPath: string) {
// 2-second delay to release file handles
// Recursive directory removal
// Silent failure (doesn't throw)
}Purpose: Clean up TempOutput directory
Delay: 2 seconds (allows file handles to be released)
Error Handling: Silent failure (cleanup not critical)
Upload Process:
- Compress files to 8MB segments
- Upload segments to Discord
- Create
metadata.jsonwith upload metadata - Send metadata.json as file attachment
- Clean up temporary files
Format:
{
"originalName": "filename.ext",
"totalSize": "150.50 MB",
"createdAt": "1/27/2026, 10:30:45 AM",
"parts": [
{
"name": "filename.7z.001",
"url": "https://discord.com/channels/..."
}
]
}- Parse Metadata: Supports both attachment and legacy formats
- Create Directory: With proper folder naming
- Save Metadata: Write to disk (required by Restore)
- Download Parts: Stream-based using
pipeline() - Reassemble: Call
Restore()with metadata - Cleanup: Remove parts and metadata.json
# Update to v0.1.0
npm install
# That's it! Your existing code still worksIf you extended DCloudClass, update any direct calls to initializeNewChannel():
// β Old way (no longer works)
const thread = await dcloud.initializeNewChannel(filename);
// β
New way
const thread = await dcloud.initializeNewChannel(filename, filepath);
// β
Alternative (recommended)
const result = await dcloud.upload(filepath);- Old Format:
metadata.jsoncode block in Discord message - New Format:
metadata.jsonfile attachment - Downloads: Both formats supported automatically β
-
ensureFileReady()with different file sizes -
cleanupFolder()with missing files - Metadata serialization/deserialization
- Upload small file (< 8MB)
- Upload medium file (50-100MB)
- Upload folder with multiple files
- Download with new metadata format
- Download with legacy metadata format
- Partial failure recovery
- File locked by another process
- Disk space exhausted
- Discord API rate limiting
- Network interruption during upload
- Corrupted metadata.json
- β No breaking security changes
- β
Removed
axios(fewer dependencies = smaller attack surface) - β Native fetch API used (built-in security)
- Keep bot token in
.envfile - Don't commit sensitive credentials
- Use Discord OAuth2 for production deployments
- Regularly update dependencies
Problem: "Metadata message was null"
- Cause: Discord API error when sending message
- Solution: Check bot permissions, Discord API status
Problem: "File not found at path"
- Cause: Input path doesn't exist or is inaccessible
- Solution: Verify path exists and is readable
Problem: "7zip binary not found"
- Cause: 7zip-bin not properly installed
- Solution: Reinstall:
npm install --save 7zip-bin
Problem: "No parts were generated"
- Cause: Compression failed or produced no output
- Solution: Check file permissions, available disk space
Enable detailed logging:
const dcloud = DCloud({
TOKEN: "your-token",
SERVER_ID: "your-server",
FORUM_CHANNEL_ID: "your-channel",
});
// All errors logged with chalk colors
// Check console for detailed outputMain class for file operations.
constructor(config: ICloudBot)Methods:
init(): Promise<void>- Initialize bot connectionupload(inputPath: string): Promise<ICompressorResult>- Upload file/folderdownloader(messageLink: string, output: string): Promise<void>- Download file
Handles Discord bot operations.
extends ClientMethods:
Init(): Promise<void>- Login to DiscordIsBotOnline(): boolean- Check connection statusinitializeNewThread(name: string, msg: EmbedBuilder): Promise<ThreadChannel>- Create forum threadsendToForumChannel(filePath: string, fileName: string): Promise<string | null>- Upload file to thread
interface ICloudBot {
TOKEN: string;
SERVER_ID: string;
FORUM_CHANNEL_ID: string;
}
interface ICompressor {
originalName: string;
totalSize: string;
createdAt: string;
parts: Array<{ name: string; url: string }>;
}
interface ICompressorResult {
originalName: string;
totalSize: string;
createdAt: string;
metadata: string;
}- Read the Quick Start section
- Review Features
- Check Configuration
- Understand Project Structure
- Review API Documentation
- Explore source code in
src/
- Read the Development section
- Review Technical Details
- Run tests before submitting PRs
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
# Install dependencies
npm install
# Development mode (with auto-reload)
npm run dev
# Build
npm run build
# Lint code
npm run lint
# Type check
npm run type-check
# Run compiled version
npm startThis project is licensed under the MIT License - see the LICENSE file for details.
Neel Frostrain
- GitHub: @NeelFrostrain
- Repository: DCloud
- Discord.js team for the amazing Discord API library
- 7-Zip project for the compression algorithm
- Node.js community
For issues, questions, or suggestions:
- Check Troubleshooting
- Review FAQ
- Open an issue on GitHub
- Provide:
- Error messages and logs
- Steps to reproduce
- System information
Last Updated: January 27, 2026
Current Version: 0.1.0
This project was created with β€οΈ for the Discord community