goat
command
ملف
جلب كود أمر
0
views
0
likes
0
installs
Aliases: filecmd, file
raw source
const fs = require("fs");
const path = require("path");
module.exports = {
config: {
name: "ملف",
aliases: ["filecmd", "file"],
version: "1.0",
author: "nexo_here",
countDown: 5,
role: 2,
shortDescription: "جلب كود أمر",
longDescription: "جلب كود أمر",
category: "owner",
guide: "{pn} <اسم الأمر>"
},
onStart: async function ({ args, message }) {
const cmdName = args[0];
if (!cmdName) return message.reply("❌ | يرجى إدخال اسم الأمر.\nمثال: filecmd fluxsnell");
const cmdPath = path.join(__dirname, `${cmdName}.js`);
if (!fs.existsSync(cmdPath)) return message.reply(`❌ | Command "${cmdName}" غير موجود في هذا المجلد.`);
try {
const code = fs.readFileSync(cmdPath, "utf8");
if (code.length > 19000) {
return message.reply("⚠️ | This file is too large to display.");
}
return message.reply({
body: `📄 | Source code of "${cmdName}.js":\n\n${code}`
});
} catch (err) {
console.error(err);
return message.reply("❌ | Error reading the file.");
}
}
};