@getsolara/solara.js
Version:
A lightweight and modular Discord bot framework built on discord.js v14, with truly optional feature packages.
10 lines • 539 B
JavaScript
const fs = require('fs').promises;
module.exports = {
name: "$createDirectory", description: "Creates a directory [SECURITY RISK - OWNER ONLY]. Args: dirPath", takesBrackets: true,
execute: async (context, args) => {
if (!args[0]) return "[Error: Requires dirPath]"; const dirPath = args[0];
if (dirPath.includes('..')) return "[Error: Invalid path]";
try { await fs.mkdir(dirPath, { recursive: true }); return ""; }
catch (e) { return `[Error creating directory: ${e.message}]`; }
}
};