Merge pull request #10 from ZerioDev/feature/playlists
🎉 Support playlists
This commit is contained in:
@@ -15,14 +15,22 @@ exports.run = async (client, message, args) => {
|
|||||||
if(aTrackIsAlreadyPlaying){
|
if(aTrackIsAlreadyPlaying){
|
||||||
|
|
||||||
// Add the track to the queue
|
// Add the track to the queue
|
||||||
const track = await client.player.addToQueue(message.guild.id, args.join(" "));
|
const result = await client.player.addToQueue(message.guild.id, args[0]);
|
||||||
message.channel.send(`Track ${track.name} added to queue ${emotes.music}`);
|
if(result.type === 'playlist'){
|
||||||
|
message.channel.send(`${result.tracks.length} songs added to the queue ${emotes.music}`);
|
||||||
|
} else {
|
||||||
|
message.channel.send(`${result.name} added to the queue ${emotes.music}`);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Else, play the song
|
// Else, play the song
|
||||||
const song = await client.player.play(message.member.voice.channel, args.join(" "));
|
const result = await client.player.play(message.member.voice.channel, args.join(" "));
|
||||||
message.channel.send(`Currently playing ${song.name} ${emotes.music}`);
|
if(result.type === 'playlist'){
|
||||||
|
message.channel.send(`${result.tracks.length} songs added to the queue ${emotes.music}\nCurrently playing **${result.tracks[0].name}**!`);
|
||||||
|
} else {
|
||||||
|
message.channel.send(`Currently playing ${result.name} ${emotes.music}`);
|
||||||
|
}
|
||||||
|
|
||||||
const queue = client.player.getQueue(message.guild.id)
|
const queue = client.player.getQueue(message.guild.id)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user