API-XX commited on
Commit
c78f9c1
Β·
verified Β·
1 Parent(s): 7f51d1b

Upload case.js

Browse files
Files changed (1) hide show
  1. case.js +100 -2
case.js CHANGED
@@ -975,7 +975,9 @@ module.exports = async (conn, dev, chatUpdate, store) => {
975
  > ─────────────❐
976
 
977
  > β”€γ€Ž \`π’π“π€π‹πŠπ„π‘ πŒπ„ππ”\` 』
978
-
 
 
979
  > ─────────────❐
980
 
981
  > β”€γ€Ž \`𝐀𝐃𝐕𝐀𝐍𝐂𝐄 π“πŽπŽπ‹π’\` 』
@@ -3906,7 +3908,7 @@ case 'spotify': {
3906
  image: {
3907
  url: image
3908
  },
3909
- caption: font(`🎨 *Random Color*\n\nπŸ”Ή *Name*: ${name}\nπŸ”Ή *HEX*: #${hex}\n\n> ${caption}`),
3910
  }, {
3911
  quoted: m
3912
  });
@@ -3917,8 +3919,104 @@ case 'spotify': {
3917
  }
3918
  break;
3919
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3920
 
 
 
 
 
3921
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3922
 
3923
 
3924
 
 
975
  > ─────────────❐
976
 
977
  > β”€γ€Ž \`π’π“π€π‹πŠπ„π‘ πŒπ„ππ”\` 』
978
+ > ${sign} ${prefix}npmstalk
979
+ > ${sign} ${prefix}country
980
+ > ${sign} ${prefix}wachannel
981
  > ─────────────❐
982
 
983
  > β”€γ€Ž \`𝐀𝐃𝐕𝐀𝐍𝐂𝐄 π“πŽπŽπ‹π’\` 』
 
3908
  image: {
3909
  url: image
3910
  },
3911
+ caption: fontx(`🎨 *Random Color*\n\nπŸ”Ή *Name*: ${name}\nπŸ”Ή *HEX*: #${hex}\n\n> ${caption}`),
3912
  }, {
3913
  quoted: m
3914
  });
 
3919
  }
3920
  break;
3921
  }
3922
+ case 'npmstalk': case 'npmstalk': {
3923
+ if (!q) return reply("❌ Please provide an NPM package name.\n\nExample: *!npmstalk express*");
3924
+
3925
+ await loading();
3926
+ let apiUrl = `https://api-xx-xi.hf.space/api/npmcheck?package=${encodeURIComponent(q)}`;
3927
+
3928
+ try {
3929
+ let response = await fetch(apiUrl);
3930
+ let json = await response.json();
3931
+
3932
+ if (!json.success) {
3933
+ return reply("❌ Package not found. Please check the package name and try again.");
3934
+ }
3935
+
3936
+ let npmInfo = fontx(`πŸ“¦ *NPM Package Info*\n\n`) +
3937
+ fontx(`πŸ“› *Package:* ${json.package}\n`) +
3938
+ fontx(`πŸ†• *Version:* ${json.version}\n`) +
3939
+ fontx(`πŸ“… *Published:* ${json.publishedDate}\n`) +
3940
+ fontx(`πŸ“Š *Version Count:* ${json.versionNumber}\n`) +
3941
+ fontx(`πŸ”— *Dependents:* ${json.dependentsCount}\n`) +
3942
+ fontx(`πŸ“‚ *Dependencies:* ${json.dependenciesCount}\n> ${caption}`);
3943
+
3944
+ conn.sendMessage(m.chat, {
3945
+ image: { url: json.codetypeimg },
3946
+ caption: npmInfo
3947
+ }, { quoted: m });
3948
+
3949
+ } catch (error) {
3950
+ console.error("Error fetching NPM package info:", error);
3951
+ reply("❌ An error occurred while retrieving the package details. Please try again later.");
3952
+ }
3953
+ break;
3954
+ }
3955
+ case 'wachannel': {
3956
+ if (!q) return reply("❌ Please provide a WhatsApp Channel link.\n\nExample: *!wachannel https://whatsapp.com/channel/0029Vah3fKtCnA7oMPTPJm1h*");
3957
+
3958
+ await loading();
3959
+ let apiUrl = `https://api-xx-xi.hf.space/api/wachannel?url=${encodeURIComponent(q)}`;
3960
+
3961
+ try {
3962
+ let response = await fetch(apiUrl);
3963
+ let json = await response.json();
3964
+
3965
+ if (!json.success) {
3966
+ return reply("❌ Channel not found. Please check the link and try again.");
3967
+ }
3968
+
3969
+ let channelInfo = fontx(`πŸ“’ *WhatsApp Channel Info*\n\n`) +
3970
+ fontx(`πŸ“› *Name:* ${json.data.name}\n`) +
3971
+ fontx(`πŸ‘₯ *Followers:* ${json.data.followers}\n`) +
3972
+ fontx(`πŸ“ *Description:* ${json.data.description}\n> ${caption}`);
3973
 
3974
+ conn.sendMessage(m.chat, {
3975
+ image: { url: json.data.image },
3976
+ caption: channelInfo
3977
+ }, { quoted: m });
3978
 
3979
+ } catch (error) {
3980
+ console.error("Error fetching WhatsApp Channel info:", error);
3981
+ reply("❌ An error occurred while retrieving the channel details. Please try again later.");
3982
+ }
3983
+ break;
3984
+ }
3985
+ case 'country': {
3986
+ if (!q) return reply("❌ Please provide a country name.\n\nExample: *!country Nigeria*");
3987
+
3988
+ await loading();
3989
+ let apiUrl = `https://api-xx-xi.hf.space/api/country?q=${encodeURIComponent(q)}`;
3990
+
3991
+ try {
3992
+ let response = await fetch(apiUrl);
3993
+ let json = await response.json();
3994
+
3995
+ if (!json.success) {
3996
+ return reply("❌ Country not found. Please check the spelling and try again.");
3997
+ }
3998
+
3999
+ let countryInfo = fontx(`🌍 *Country Information*\n\n`) +
4000
+ fontx(`πŸ“› *Name:* ${json.data.name}\n`) +
4001
+ fontx(`πŸ™οΈ *Capital:* ${json.data.capital}\n`) +
4002
+ fontx(`πŸ“ž *Phone Code:* ${json.data.phoneCode}\n`) +
4003
+ fontx(`πŸ’° *Currency:* ${json.data.currency}\n`) +
4004
+ fontx(`πŸš— *Driving Side:* ${json.data.drivingSide}\n`) +
4005
+ fontx(`🌐 *Internet TLD:* ${json.data.internetTLD}\n`) +
4006
+ fontx(`πŸ“ *Location:* [Google Maps](${json.data.googleMapsLink})\n`) +
4007
+ fontx(`πŸ—ΊοΈ *Continent:* ${json.data.continent.emoji} ${json.data.continent.name}`);
4008
+
4009
+ conn.sendMessage(m.chat, {
4010
+ image: { url: json.data.flag },
4011
+ caption: countryInfo
4012
+ }, { quoted: m });
4013
+
4014
+ } catch (error) {
4015
+ console.error("Error fetching country info:", error);
4016
+ reply("❌ An error occurred while retrieving country details. Please try again later.");
4017
+ }
4018
+ break;
4019
+ }
4020
 
4021
 
4022