mirror of
https://github.com/musix-org/musix-oss
synced 2025-07-07 01:20:48 +00:00
Chore update 3.7
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
const ytsr = require('ytsr');
|
||||
const SpotifyApi = require("spotify-web-api-node");
|
||||
const he = require('he');
|
||||
|
||||
module.exports = {
|
||||
@ -10,6 +11,12 @@ module.exports = {
|
||||
permission: 'none',
|
||||
category: 'music',
|
||||
async execute(msg, args, client, Discord, command) {
|
||||
const spotify = new SpotifyApi({
|
||||
id: client.config.spotify_client_id,
|
||||
secret: client.config.spotify_client_secret,
|
||||
});
|
||||
spotify.setAccessToken(client.config.spotify_access_key);
|
||||
|
||||
const searchString = args.slice(1).join(" ");
|
||||
const queue = client.queue.get(msg.guild.id);
|
||||
const voiceChannel = msg.member.voice.channel;
|
||||
@ -47,6 +54,20 @@ module.exports = {
|
||||
return msg.channel.send(client.messages.cancellingVideoSelection);
|
||||
}
|
||||
const videoIndex = parseInt(response.first().content) - 1;
|
||||
spotify.searchTracks(`track:${videos[videoIndex].title}`)
|
||||
.then(function (data) {
|
||||
client.funcs.handleVideo(
|
||||
videoResults[0].link,
|
||||
msg,
|
||||
voiceChannel,
|
||||
client,
|
||||
false,
|
||||
"ytdl",
|
||||
data.body.tracks.items[0]
|
||||
);
|
||||
}, function (err) {
|
||||
console.log('Something went wrong!', err);
|
||||
});
|
||||
return client.funcs.handleVideo(videos[videoIndex].link, msg, voiceChannel, client, false, "ytdl");
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user