Upload case.js
Browse files
case.js
CHANGED
@@ -997,7 +997,8 @@ module.exports = async (conn, dev, chatUpdate, store) => {
|
|
997 |
> โโโโโโโโโโโโโโ
|
998 |
|
999 |
> โใ \`๐๐๐๐๐๐๐ ๐๐๐๐๐\` ใ
|
1000 |
-
|
|
|
1001 |
> โโโโโโโโโโโโโโ
|
1002 |
|
1003 |
> โใ \`๐
๐๐ ๐๐๐๐\` ใ
|
@@ -1764,8 +1765,100 @@ case 'kick': {
|
|
1764 |
|
1765 |
|
1766 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1767 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1768 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1769 |
case 'gross': {
|
1770 |
const grossEmojis = [
|
1771 |
'๐คข', '๐คฎ', '๐', '๐ซ', '๐คข๐คข', '๐คฎ๐คฎ', '๐ตโ๐ซ', '๐คง', '๐คข๐คฎ', '๐ท',
|
|
|
997 |
> โโโโโโโโโโโโโโ
|
998 |
|
999 |
> โใ \`๐๐๐๐๐๐๐ ๐๐๐๐๐\` ใ
|
1000 |
+
> ${sign} fetch
|
1001 |
+
> ${sign} getdevice
|
1002 |
> โโโโโโโโโโโโโโ
|
1003 |
|
1004 |
> โใ \`๐
๐๐ ๐๐๐๐\` ใ
|
|
|
1765 |
|
1766 |
|
1767 |
|
1768 |
+
case 'getdevice':
|
1769 |
+
case 'device':
|
1770 |
+
case 'phone': {
|
1771 |
+
if (!m.quoted && mentionByTag.length === 0) {
|
1772 |
+
return reply(`Please *reply* to a message or *tag* a user with *${prefix + command}* to get device information.`);
|
1773 |
+
}
|
1774 |
|
1775 |
+
try {
|
1776 |
+
await loading();
|
1777 |
+
let targetMessage;
|
1778 |
+
|
1779 |
+
if (m.quoted) {
|
1780 |
+
targetMessage = m.quoted.id || m.key.id;
|
1781 |
+
} else if (mentionByTag.length) {
|
1782 |
+
targetMessage = mentionByTag[0];
|
1783 |
+
}
|
1784 |
|
1785 |
+
if (!targetMessage) return reply("Unable to fetch device information. Please try again later.");
|
1786 |
+
|
1787 |
+
const deviceInfo = await getDevice(targetMessage);
|
1788 |
+
if (!deviceInfo) return reply("Unable to retrieve device details.");
|
1789 |
+
|
1790 |
+
await conn.sendMessage(m.chat, {
|
1791 |
+
text: fontx(`๐ฑ *\`device type\`* *${deviceInfo}*`),
|
1792 |
+
}, { quoted: m });
|
1793 |
+
|
1794 |
+
} catch (error) {
|
1795 |
+
reply("An error occurred while fetching the device information. Please try again later.");
|
1796 |
+
}
|
1797 |
+
break;
|
1798 |
+
}
|
1799 |
+
case 'fetch': {
|
1800 |
+
if (!q) return reply(`\`No link detected\`\nExample: *${prefix + command} https://example.com/media.mp4*`);
|
1801 |
+
await loading();
|
1802 |
+
try {
|
1803 |
+
let url = q.trim();
|
1804 |
+
let response = await fetch(url, {
|
1805 |
+
method: 'HEAD'
|
1806 |
+
});
|
1807 |
+
|
1808 |
+
if (!response.ok) {
|
1809 |
+
return conn.sendMessage(m.chat, {
|
1810 |
+
text: `โ *Failed to fetch the link.*\nStatus: ${response.status}`
|
1811 |
+
});
|
1812 |
+
}
|
1813 |
+
|
1814 |
+
let contentType = response.headers.get('content-type') || '';
|
1815 |
+
let filename = url.split('/').pop().split('?')[0];
|
1816 |
+
|
1817 |
+
let messageOptions = {
|
1818 |
+
caption: `๐ *Fetched Content*\n๐ *Filename:* ${filename}`
|
1819 |
+
};
|
1820 |
+
|
1821 |
+
if (contentType.includes('image')) {
|
1822 |
+
conn.sendMessage(m.chat, {
|
1823 |
+
image: {
|
1824 |
+
url
|
1825 |
+
},
|
1826 |
+
...messageOptions
|
1827 |
+
});
|
1828 |
+
} else if (contentType.includes('video')) {
|
1829 |
+
conn.sendMessage(m.chat, {
|
1830 |
+
video: {
|
1831 |
+
url
|
1832 |
+
},
|
1833 |
+
...messageOptions
|
1834 |
+
});
|
1835 |
+
} else if (contentType.includes('audio')) {
|
1836 |
+
conn.sendMessage(m.chat, {
|
1837 |
+
audio: {
|
1838 |
+
url
|
1839 |
+
},
|
1840 |
+
mimetype: 'audio/mpeg',
|
1841 |
+
...messageOptions
|
1842 |
+
});
|
1843 |
+
} else {
|
1844 |
+
conn.sendMessage(m.chat, {
|
1845 |
+
document: {
|
1846 |
+
url
|
1847 |
+
},
|
1848 |
+
mimetype: contentType || 'application/octet-stream',
|
1849 |
+
fileName: filename,
|
1850 |
+
...messageOptions
|
1851 |
+
});
|
1852 |
+
}
|
1853 |
+
|
1854 |
+
} catch (error) {
|
1855 |
+
console.error("Error in fetch case:", error);
|
1856 |
+
conn.sendMessage(m.chat, {
|
1857 |
+
text: "โ An error occurred while fetching the content. Please try again later."
|
1858 |
+
});
|
1859 |
+
}
|
1860 |
+
break;
|
1861 |
+
}
|
1862 |
case 'gross': {
|
1863 |
const grossEmojis = [
|
1864 |
'๐คข', '๐คฎ', '๐', '๐ซ', '๐คข๐คข', '๐คฎ๐คฎ', '๐ตโ๐ซ', '๐คง', '๐คข๐คฎ', '๐ท',
|