forked from tuhinpal/WhatsBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsong.js
26 lines (24 loc) · 869 Bytes
/
song.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//jshint esversion:8
const fs = require("fs");
const path = require("path");
const { search } = require("../helpers/song");
const execute = async (client, msg, args) => {
msg.delete(true);
let getdata = await search(args.join(" "));
let sendmessage = await client.sendMessage(msg.to, getdata.content); // have to grab the message ID
if (getdata.status) {
fs.writeFileSync(
path.join(__dirname, `../cache/song~${sendmessage.id.id}.json`),
JSON.stringify(getdata.songarray)
);
}
};
module.exports = {
name: "Search Song",
description: "Search songs on jiosaavn",
command: "!song",
commandType: "plugin",
isDependent: false,
help: `*Song*\n\nSearch a song and download it. \n\n*!song [search-query]*\nEx: !song makhna\n\nThen reply the message with *!dldsong [id]*\nEx. !dldsong 1\n\n⚡ Powered by musicder.net`,
execute,
};