Skip to content

Commit

Permalink
> V3
Browse files Browse the repository at this point in the history
  • Loading branch information
GlobalTechInfo authored Oct 11, 2024
1 parent a23cd95 commit aa10b5c
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions plugins/dl-modapk.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
import { download } from 'aptoide-scraper'
import { download } from 'aptoide-scraper';

let handler = async (m, { conn, usedPrefix: prefix, command, text }) => {
try {
if (command === 'apk') {
if (!text) throw `*[❗] Please provide the APK Name you want to download.*`
if (!text) throw `*[❗] Please provide the APK Name you want to download.*`;

await conn.reply(m.chat, global.wait, m)
let data = await download(text)
await conn.reply(m.chat, global.wait, m);
console.log('Starting download...'); // Debugging log
let data = await download(text);
console.log('Download data:', data); // Debugging log

if (data.size.replace(' MB', '') > 200) {
return await conn.sendMessage(
m.chat,
{ text: '*[⛔] The file is too large.*' },
{ quoted: m }
)
);
}

if (data.size.includes('GB')) {
return await conn.sendMessage(
m.chat,
{ text: '*[⛔] The file is too large.*' },
{ quoted: m }
)
);
}

await conn.sendMessage(
Expand All @@ -33,14 +35,15 @@ let handler = async (m, { conn, usedPrefix: prefix, command, text }) => {
caption: null,
},
{ quoted: m }
)
);
}
} catch {
throw `*[❗] An error occurred. Make sure to provide a valid link.*`
} catch (error) {
console.error(error); // Log the actual error for debugging
throw `*[❗] An error occurred. Make sure to provide a valid link.*`;
}
}

handler.help = ['modapk']
handler.tags = ['downloader']
handler.command = /^apk$/i
export default handler
handler.help = ['modapk'];
handler.tags = ['downloader'];
handler.command = /^apk$/i;
export default handler;

0 comments on commit aa10b5c

Please sign in to comment.