1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-11-10 08:10:18 +00:00

Update playlist.js

This commit is contained in:
MatteZ02 2019-10-23 20:45:22 +03:00
parent 1917fe7784
commit 72e600454f

View File

@ -70,6 +70,7 @@ module.exports = {
}; };
message.channel.send(":white_check_mark: Queue saved!"); message.channel.send(":white_check_mark: Queue saved!");
} else if (args[1] === 'add') { } else if (args[1] === 'add') {
if (client.global.db.playlists[args[2]].saved) {
const youtube = new YouTube(client.config.apikey); const youtube = new YouTube(client.config.apikey);
const searchString = args.slice(2).join(" "); const searchString = args.slice(2).join(" ");
const url = args[2] ? args[2].replace(/<(.+)>/g, "$1") : ""; const url = args[2] ? args[2].replace(/<(.+)>/g, "$1") : "";
@ -110,11 +111,12 @@ module.exports = {
} }
client.global.db.playlists[message.guild.id].songs.push(song); client.global.db.playlists[message.guild.id].songs.push(song);
message.channel.send(`:white_check_mark: ${song.title} added to the playlist!`); message.channel.send(`:white_check_mark: ${song.title} added to the playlist!`);
} else return message.channel.send(':x: There is no playlist saved! Start by using the save option!')
} else { } else {
const embed = new Discord.RichEmbed() const embed = new Discord.RichEmbed()
.setTitle('Options for playlist!') .setTitle('Options for playlist!')
.addField('play', 'Play the guild specific queue.', true) .addField('play', 'Play the guild specific queue.', true)
.addField('save', 'Save the currently playing queue.', true) .addField('save', 'Save the currently playing queue. Note that this will overwrite the currently saved queue!', true)
.addField('add', 'Add songs to the playlist. Like song selection', true) .addField('add', 'Add songs to the playlist. Like song selection', true)
.setFooter(`how to use: ${prefix}playlist <Option> <Optional option>`) .setFooter(`how to use: ${prefix}playlist <Option> <Optional option>`)
.setAuthor(client.user.username, client.user.displayAvatarURL) .setAuthor(client.user.username, client.user.displayAvatarURL)