forked from VryptLab/EternityBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlyrics.js
More file actions
19 lines (18 loc) · 700 Bytes
/
Copy pathlyrics.js
File metadata and controls
19 lines (18 loc) · 700 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import axios from "axios";
export default {
name: "lyrics",
category: "fun",
command: ["lyrics", "lirik"],
settings: {},
run: async (conn, m, { text }) => {
if (!text) return m.reply("Tulis judul lagu.\nContoh: *.lyrics perfect ed sheeran*");
try {
const res = await axios.get(`https://some-random-api.com/lyrics?title=${encodeURIComponent(text)}`);
const { title, author, lyrics } = res.data;
const caption = `🎶 *${title}* - ${author}\n\n${lyrics.slice(0, 2000)}${lyrics.length > 2000 ? "..." : ""}`;
await m.reply(caption);
} catch {
m.reply("Lirik tidak ditemukan 😔");
}
}
}