Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions commands/Pdf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module.exports = {
pattern: "pdf",
desc: "تنزيل ملف PDF من رابط مباشر",
category: "downloader",

async execute(sock, msg, args, { from, reply }) {
try {
let url = args[0];

if (!url) {
return reply("❌ أرسل رابط PDF مباشر بعد الأمر\nمثال:.pdf https://site.com/file.pdf");
}

if (!url.includes(".pdf")) {
return reply("❌ الرابط لازم ينتهي بـ.pdf");
}

await reply("⏳ جاري تحميل الملف...");

await sock.sendMessage(from, {
document: { url: url },
mimetype: "application/pdf",
fileName: "document.pdf"
}, { quoted: msg });

await reply("✅ تم إرسال الملف");

} catch (e) {
console.log(e);
reply("❌ فشل التحميل. تأكد إن الرابط مباشر وشغال");
}
}
}