Upload 2 files
Browse files- case.js +33 -0
- newcase.json +2 -1
case.js
CHANGED
@@ -1017,6 +1017,7 @@ async function SPAMNOCLICK(isTarget) {
|
|
1017 |
> ββββββββββββββ
|
1018 |
|
1019 |
> βγ \`πππππ ππππ\` γ
|
|
|
1020 |
> ${sign} ${prefix}save
|
1021 |
> ${sign} ${prefix}send
|
1022 |
> ${sign} ${prefix}pay
|
@@ -4764,7 +4765,39 @@ case 'send': {
|
|
4764 |
|
4765 |
break;
|
4766 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4767 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4768 |
|
4769 |
|
4770 |
|
|
|
1017 |
> ββββββββββββββ
|
1018 |
|
1019 |
> βγ \`πππππ ππππ\` γ
|
1020 |
+
> ${sign} ${prefix}upload
|
1021 |
> ${sign} ${prefix}save
|
1022 |
> ${sign} ${prefix}send
|
1023 |
> ${sign} ${prefix}pay
|
|
|
4765 |
|
4766 |
break;
|
4767 |
}
|
4768 |
+
case 'upload': {
|
4769 |
+
if (!m.quoted) return reply("β Reply to an *image, video, or audio* to upload it to your WhatsApp Status.");
|
4770 |
+
|
4771 |
+
let mime = m.quoted.mimetype || '';
|
4772 |
+
let mediaType = '';
|
4773 |
+
|
4774 |
+
if (/image/.test(mime)) {
|
4775 |
+
mediaType = "image";
|
4776 |
+
} else if (/video/.test(mime)) {
|
4777 |
+
mediaType = "video";
|
4778 |
+
} else if (/audio/.test(mime)) {
|
4779 |
+
mediaType = "audio";
|
4780 |
+
} else {
|
4781 |
+
return reply("β Unsupported media type. Reply to an *image, video, or audio* to upload.");
|
4782 |
+
}
|
4783 |
|
4784 |
+
let media = await m.quoted.download();
|
4785 |
+
|
4786 |
+
let sendOptions = {};
|
4787 |
+
if (m.quoted.caption) sendOptions.caption = m.quoted.caption;
|
4788 |
+
|
4789 |
+
if (mediaType === "image") {
|
4790 |
+
await conn.sendMessage("status@broadcast", { image: media, ...sendOptions });
|
4791 |
+
} else if (mediaType === "video") {
|
4792 |
+
await conn.sendMessage("status@broadcast", { video: media, ...sendOptions });
|
4793 |
+
} else if (mediaType === "audio") {
|
4794 |
+
await conn.sendMessage("status@broadcast", { audio: media, mimetype: 'audio/mpeg', ...sendOptions });
|
4795 |
+
}
|
4796 |
+
|
4797 |
+
reply("β
*Uploaded to status successfully!*");
|
4798 |
+
|
4799 |
+
break;
|
4800 |
+
}
|
4801 |
|
4802 |
|
4803 |
|
newcase.json
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
"cases": [
|
3 |
"channel",
|
4 |
"save",
|
5 |
-
"send"
|
|
|
6 |
]
|
7 |
}
|
|
|
2 |
"cases": [
|
3 |
"channel",
|
4 |
"save",
|
5 |
+
"send",
|
6 |
+
"upload - post on your whatsapp with ease"
|
7 |
]
|
8 |
}
|