Upload case.js
Browse files
case.js
CHANGED
@@ -996,6 +996,8 @@ module.exports = async (conn, dev, chatUpdate, store) => {
|
|
996 |
> ${sign} ${prefix}qr
|
997 |
> ${sign} ${prefix}script
|
998 |
> ${sign} ${prefix}sticker
|
|
|
|
|
999 |
> ββββββββββββββ
|
1000 |
|
1001 |
> βγ \`ππππππ ππππ\` γ
|
@@ -3695,39 +3697,67 @@ case 'mediafire': {
|
|
3695 |
}
|
3696 |
break;
|
3697 |
}
|
3698 |
-
case 's':
|
3699 |
-
case 'sticker':
|
3700 |
-
case '
|
3701 |
-
|
3702 |
-
|
3703 |
-
|
3704 |
-
|
3705 |
-
|
3706 |
-
|
3707 |
-
|
3708 |
-
|
3709 |
-
|
3710 |
-
|
3711 |
-
|
3712 |
-
|
3713 |
-
|
3714 |
-
|
3715 |
-
|
3716 |
-
|
3717 |
-
|
3718 |
-
|
3719 |
-
|
3720 |
-
|
3721 |
-
|
3722 |
-
|
3723 |
-
|
3724 |
-
|
3725 |
-
|
3726 |
-
|
3727 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3728 |
|
|
|
|
|
|
|
|
|
|
|
3729 |
|
|
|
|
|
|
|
3730 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3731 |
|
3732 |
|
3733 |
|
|
|
996 |
> ${sign} ${prefix}qr
|
997 |
> ${sign} ${prefix}script
|
998 |
> ${sign} ${prefix}sticker
|
999 |
+
> ${sign} ${prefix}getjid
|
1000 |
+
> ${sign} ${prefix}fancy
|
1001 |
> ββββββββββββββ
|
1002 |
|
1003 |
> βγ \`ππππππ ππππ\` γ
|
|
|
3697 |
}
|
3698 |
break;
|
3699 |
}
|
3700 |
+
case 's':
|
3701 |
+
case 'sticker':
|
3702 |
+
case 'take': {
|
3703 |
+
if (!m.quoted) {
|
3704 |
+
return reeply(`*Reply to an image or video with the caption ${prefix + command}*\n> Video Duration: 1-9 Seconds`);
|
3705 |
+
}
|
3706 |
+
let mime = (m.quoted.msg || m.quoted).mimetype || '';
|
3707 |
+
try {
|
3708 |
+
if (/image/.test(mime)) {
|
3709 |
+
let media = await m.quoted.download();
|
3710 |
+
await conn.sendImageAsSticker(m.chat, media, m, {
|
3711 |
+
packname: fontx(caption) || 'Sticker Pack',
|
3712 |
+
author: fontx('blue demon') || 'Bot'
|
3713 |
+
});
|
3714 |
+
} else if (/video/.test(mime)) {
|
3715 |
+
if ((m.quoted.msg || m.quoted).seconds > 9) {
|
3716 |
+
return reply(`*Video duration must be 1-9 seconds!*\nReply to a shorter video with ${prefix + command}`);
|
3717 |
+
}
|
3718 |
+
let media = await m.quoted.download();
|
3719 |
+
await conn.sendVideoAsSticker(m.chat, media, m, {
|
3720 |
+
packname: fontx(caption) || 'Sticker Pack',
|
3721 |
+
author: fontx('blue demon') || 'Bot'
|
3722 |
+
});
|
3723 |
+
} else {
|
3724 |
+
reply(`*Unsupported media type!*\nReply to an image or video with the caption ${prefix + command}\n> Video Duration: 1-9 Seconds`);
|
3725 |
+
}
|
3726 |
+
} catch (err) {
|
3727 |
+
console.error('Error creating sticker:', err);
|
3728 |
+
reply(`Failed to create sticker. Please try again.`);
|
3729 |
+
}
|
3730 |
+
}
|
3731 |
+
break;
|
3732 |
+
case 'getjid': {
|
3733 |
+
reply(from)
|
3734 |
+
}
|
3735 |
+
case 'fancy': {
|
3736 |
+
if (!q) return reply("β Please provide a text to convert.\n\nExample: *!fancy Blue Demon*");
|
3737 |
+
|
3738 |
+
await loading();
|
3739 |
+
let apiUrl = `https://api-xx-xi.hf.space/api/font?text=${encodeURIComponent(q)}`;
|
3740 |
+
|
3741 |
+
try {
|
3742 |
+
let response = await fetch(apiUrl);
|
3743 |
+
let json = await response.json();
|
3744 |
|
3745 |
+
if (!json.success || !json.fancy_texts.length) {
|
3746 |
+
return reply("β Failed to fetch fancy fonts. Please try again.");
|
3747 |
+
}
|
3748 |
+
|
3749 |
+
let fancyTextList = json.fancy_texts.slice(0, 15).map((text, i) => `${i + 1}. *${text}*`).join("\n");
|
3750 |
|
3751 |
+
conn.sendMessage(m.chat, {
|
3752 |
+
text: fontx(`π¨ *Fancy Text Generator*\n\nπ *Original:* ${json.original_text}\n\n${fancyTextList}\n\nπ Reply with a number to copy a style!`),
|
3753 |
+
}, { quoted: m });
|
3754 |
|
3755 |
+
} catch (error) {
|
3756 |
+
console.error("Error fetching fancy fonts:", error);
|
3757 |
+
reply("β An error occurred while generating fancy text. Please try again later.");
|
3758 |
+
}
|
3759 |
+
break;
|
3760 |
+
}
|
3761 |
|
3762 |
|
3763 |
|