Added random play
This commit is contained in:
24
index.js
24
index.js
@@ -32,13 +32,23 @@ client.on('message', message => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (command === "play") {
|
else if (command === "play") {
|
||||||
Genius.search_song(args.join(" "), (err, song) => {
|
if (args.length == 0) {
|
||||||
if (err) {
|
getList(message.author.id, songs => {
|
||||||
message.channel.send("Je connais pas \"" + args.join(" ") + "\".");
|
if (songs === undefined) {
|
||||||
} else {
|
message.channel.send("Vous devez ajouter des musiques à votre liste pour jouer aléatoirement.");
|
||||||
play(message, song.id);
|
} else {
|
||||||
}
|
play(message, songs[Math.floor(Math.random() * songs.length)].id);
|
||||||
});
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
Genius.search_song(args.join(" "), (err, song) => {
|
||||||
|
if (err) {
|
||||||
|
message.channel.send("Je connais pas \"" + args.join(" ") + "\".");
|
||||||
|
} else {
|
||||||
|
play(message, song.id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (command === "add") {
|
else if (command === "add") {
|
||||||
|
|||||||
Reference in New Issue
Block a user