Skip to content

Commit

Permalink
spotify, spotifysearch
Browse files Browse the repository at this point in the history
  • Loading branch information
LoL-Human committed Mar 15, 2021
1 parent a79966c commit a66924c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ package-lock.json
# config
config.json

test*.*
test*.*
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"apikey": "",
"apikey": "91b64af1c1afa0d0ad528536",
"prefix": "/"
}
32 changes: 30 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async function starts() {
const mentions = (teks, memberr, id) => {
(id == null || id == undefined || id == false) ? lolhuman.sendMessage(from, teks.trim(), extendedText, { contextInfo: { "mentionedJid": memberr } }): lolhuman.sendMessage(from, teks.trim(), extendedText, { quoted: lol, contextInfo: { "mentionedJid": memberr } })
}
async function faketoko(teks, url_image = "https://i.ibb.co/JdfQ73m/photo-2021-02-05-10-13-39.jpg", title = "LoL Human", code = "IDR", price = 10000000) {
async function faketoko(teks, url_image, title, code, price) {
var punya_wa = "[email protected]"
var buffer = await getBuffer(url_image)
const ini_cstoko = {
Expand Down Expand Up @@ -715,7 +715,7 @@ async function starts() {
reply("Success")
break
case 'faketoko':
await faketoko("Tahu Bacem")
await faketoko(teks = "Tahu Bacem", url_image = "https://i.ibb.co/JdfQ73m/photo-2021-02-05-10-13-39.jpg", title = "LoL Human", code = "IDR", price = 1000000)
break
case 'asupan':
get_result = await fetchJson(`http://api.lolhuman.xyz/api/asupan?apikey=${apikey}`)
Expand Down Expand Up @@ -744,6 +744,34 @@ async function starts() {
buffer = await getBuffer(get_result.thumb)
lolhuman.sendMessage(from, buffer, image, { quoted: lol, caption: txt })
break
case 'spotify':
url = args[0]
get_result = await fetchJson(`http://api.lolhuman.xyz/api/spotify?apikey=${apikey}&url=${url}`)
get_result = get_result.result
txt = `Title : ${get_result.title}\n`
txt += `Artists : ${get_result.artists}\n`
txt += `Duration : ${get_result.duration}\n`
txt += `Popularity : ${get_result.popularity}\n`
txt += `Preview : ${get_result.preview_url}\n`
thumbnail = await getBuffer(get_result.thumbnail)
lolhuman.sendMessage(from, thumbnail, image, { quoted: lol, caption: txt })
get_audio = await getBuffer(get_result.link[3].link)
lolhuman.sendMessage(from, get_audio, audio, { mimetype: 'audio/mp4', filename: `${get_result.title}.mp3`, quoted: lol })
break
case 'spotifysearch':
query = args.join(" ")
get_result = await fetchJson(`http://api.lolhuman.xyz/api/spotifysearch?apikey=${apikey}&query=${query}`)
get_result = get_result.result
txt = ""
for (var x in get_result) {
txt += `Title : ${get_result[x].title}\n`
txt += `Artists : ${get_result[x].artists}\n`
txt += `Duration : ${get_result[x].duration}\n`
txt += `Link : ${get_result[x].link}\n`
txt += `Preview : ${get_result[x].preview_url}\n\n\n`
}
reply(txt)
break

// Random Image //
case 'art':
Expand Down

0 comments on commit a66924c

Please sign in to comment.