Skip to content

Commit aa10b5c

Browse files
> V3
1 parent a23cd95 commit aa10b5c

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

plugins/dl-modapk.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
1-
import { download } from 'aptoide-scraper'
1+
import { download } from 'aptoide-scraper';
22

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

8-
await conn.reply(m.chat, global.wait, m)
9-
let data = await download(text)
8+
await conn.reply(m.chat, global.wait, m);
9+
console.log('Starting download...'); // Debugging log
10+
let data = await download(text);
11+
console.log('Download data:', data); // Debugging log
1012

1113
if (data.size.replace(' MB', '') > 200) {
1214
return await conn.sendMessage(
1315
m.chat,
1416
{ text: '*[⛔] The file is too large.*' },
1517
{ quoted: m }
16-
)
18+
);
1719
}
1820

1921
if (data.size.includes('GB')) {
2022
return await conn.sendMessage(
2123
m.chat,
2224
{ text: '*[⛔] The file is too large.*' },
2325
{ quoted: m }
24-
)
26+
);
2527
}
2628

2729
await conn.sendMessage(
@@ -33,14 +35,15 @@ let handler = async (m, { conn, usedPrefix: prefix, command, text }) => {
3335
caption: null,
3436
},
3537
{ quoted: m }
36-
)
38+
);
3739
}
38-
} catch {
39-
throw `*[❗] An error occurred. Make sure to provide a valid link.*`
40+
} catch (error) {
41+
console.error(error); // Log the actual error for debugging
42+
throw `*[❗] An error occurred. Make sure to provide a valid link.*`;
4043
}
4144
}
4245

43-
handler.help = ['modapk']
44-
handler.tags = ['downloader']
45-
handler.command = /^apk$/i
46-
export default handler
46+
handler.help = ['modapk'];
47+
handler.tags = ['downloader'];
48+
handler.command = /^apk$/i;
49+
export default handler;

0 commit comments

Comments
 (0)