mirror of
https://github.com/musix-org/musix-oss
synced 2024-11-10 02:00:20 +00:00
Option for song selection
This commit is contained in:
parent
89d010e2e5
commit
1190bd7de3
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,6 +1,6 @@
|
|||||||
.env
|
.env
|
||||||
serviceAccount.json
|
|
||||||
package.json
|
|
||||||
package-lock.json
|
package-lock.json
|
||||||
.vscode/
|
.vscode/
|
||||||
node_modules/
|
node_modules/
|
||||||
|
serviceAccount.json
|
||||||
|
package.json
|
@ -36,7 +36,7 @@ module.exports = {
|
|||||||
await client.funcs.handleVideo(video2, message, voiceChannel, client, true);
|
await client.funcs.handleVideo(video2, message, voiceChannel, client, true);
|
||||||
}
|
}
|
||||||
return message.channel.send(`:white_check_mark: Playlist: **${playlist.title}** has been added to the queue!`);
|
return message.channel.send(`:white_check_mark: Playlist: **${playlist.title}** has been added to the queue!`);
|
||||||
} else {
|
} else if (client.global.db.guilds[message.guild.id].songSelection) {
|
||||||
try {
|
try {
|
||||||
var video = await youtube.getVideo(url);
|
var video = await youtube.getVideo(url);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -67,6 +67,19 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return client.funcs.handleVideo(video, message, voiceChannel, client, false);
|
return client.funcs.handleVideo(video, message, voiceChannel, client, false);
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
var video = await youtube.getVideo(url);
|
||||||
|
} catch (error) {
|
||||||
|
try {
|
||||||
|
var videos = await youtube.searchVideos(searchString, 1);
|
||||||
|
var video = await youtube.getVideoByID(videos[0].id);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
return message.channel.send(':x: I could not obtain any search results!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return client.funcs.handleVideo(video, message, voiceChannel, client, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user