forked from Supositware/Haha-Yes
This commit is contained in:
parent
d9f33d3368
commit
d34c2d7a19
1 changed files with 4 additions and 3 deletions
|
@ -23,13 +23,14 @@ module.exports = class MusicCommand extends Command {
|
||||||
if (!voiceChannel) {
|
if (!voiceChannel) {
|
||||||
return message.reply('please join a voice channel first!');
|
return message.reply('please join a voice channel first!');
|
||||||
}
|
}
|
||||||
voiceChannel.join().then(connection => {
|
|
||||||
const stream = ytdl(ytblink, { filter: 'audioonly' });
|
|
||||||
const dispatcher = connection.playStream(stream);
|
|
||||||
|
|
||||||
if (ytblink == 'stop') {
|
if (ytblink == 'stop') {
|
||||||
voiceChannel.leave()
|
voiceChannel.leave()
|
||||||
} else
|
} else
|
||||||
|
voiceChannel.join().then(connection => {
|
||||||
|
const stream = ytdl(ytblink, { filter: 'audioonly' });
|
||||||
|
const dispatcher = connection.playStream(stream);
|
||||||
|
|
||||||
|
|
||||||
dispatcher.on('end', () => voiceChannel.leave());
|
dispatcher.on('end', () => voiceChannel.leave());
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue