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