Upload case.js
Browse files
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 |
|