API-XX commited on
Commit
5825179
Β·
verified Β·
1 Parent(s): 02612ac

Upload case.js

Browse files
Files changed (1) hide show
  1. case.js +52 -0
case.js CHANGED
@@ -1004,6 +1004,8 @@ module.exports = async (conn, dev, chatUpdate, store) => {
1004
 
1005
  > β”€γ€Ž \`𝐒𝐄𝐀𝐑𝐂𝐇 πŒπ„ππ”\` 』
1006
  > ${sign} ${prefix}bible
 
 
1007
  > ─────────────❐
1008
 
1009
  > β”€γ€Ž \`π€πˆ πŒπ„ππ”\` 』
@@ -3814,8 +3816,58 @@ case 'bible': {
3814
  }
3815
  break;
3816
  }
 
 
3817
 
 
 
 
 
 
 
 
 
 
 
 
 
3818
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3819
 
3820
 
3821
 
 
1004
 
1005
  > β”€γ€Ž \`𝐒𝐄𝐀𝐑𝐂𝐇 πŒπ„ππ”\` 』
1006
  > ${sign} ${prefix}bible
1007
+ > ${sign} ${prefix}lyrics
1008
+ > ${sign} ${prefix}spotify
1009
  > ─────────────❐
1010
 
1011
  > β”€γ€Ž \`π€πˆ πŒπ„ππ”\` 』
 
3816
  }
3817
  break;
3818
  }
3819
+ case 'lyrics': {
3820
+ if (!q) return reply("❌ Please provide a song name.\n\nExample: *!lyrics Not Like Us*");
3821
 
3822
+ await loading();
3823
+ let apiUrl = `https://api-xx-xi.hf.space/api/lyrics?q=${encodeURIComponent(q)}`;
3824
+
3825
+ try {
3826
+ let response = await fetch(apiUrl);
3827
+ let json = await response.json();
3828
+
3829
+ if (!json.success || !json.lyrics) {
3830
+ return reply("❌ Lyrics not found. Please check the song name and try again.");
3831
+ }
3832
+
3833
+ let lyricsMessage = `🎡 *Song Lyrics*\n\n🎢 *Title:* ${json.song}\n\nπŸ“œ *Lyrics:*\n\n${json.lyrics}\n> ${caption}`;
3834
 
3835
+ conn.sendMessage(m.chat, { text: fontx(lyricsMessage) }, { quoted: m });
3836
+
3837
+ } catch (error) {
3838
+ console.error("Error fetching lyrics:", error);
3839
+ reply("❌ An error occurred while retrieving the lyrics. Please try again later.");
3840
+ }
3841
+ break;
3842
+ }
3843
+ case 'spotify': {
3844
+ if (!q) return reply("❌ Please provide a song name.\n\nExample: *!spotify Faded*");
3845
+
3846
+ await loading();
3847
+ let apiUrl = `https://apis.davidcyriltech.my.id/search/spotify?text=${encodeURIComponent(q)}`;
3848
+
3849
+ try {
3850
+ let response = await fetch(apiUrl);
3851
+ let json = await response.json();
3852
+
3853
+ if (!json.success || json.result.length === 0) {
3854
+ return reply("❌ No results found. Please check the song name and try again.");
3855
+ }
3856
+
3857
+ let spotifyResults = fontx("🎡 *Spotify Search Results*\n\n");
3858
+
3859
+ json.result.slice(0, 5).forEach((song, index) => {
3860
+ spotifyResults += fontx(`🎢 *${song.trackName}*\nπŸ‘€ *Artist:* ${song.artistName}\nπŸ’Ώ *Album:* ${song.albumName}\n⏱️ *Duration:* ${song.duration}\nπŸ”— *Link:* `) + song.externalUrl + `\n\n`;
3861
+ });
3862
+
3863
+ conn.sendMessage(m.chat, { text: spotifyResults }, { quoted: m });
3864
+
3865
+ } catch (error) {
3866
+ console.error("Error fetching Spotify search results:", error);
3867
+ reply("❌ An error occurred while retrieving the Spotify results. Please try again later.");
3868
+ }
3869
+ break;
3870
+ }
3871
 
3872
 
3873