|
|
@ -20,7 +20,7 @@ module.exports = class MusicCommand extends Command {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async run(message, { ytblink }) {
|
|
|
|
async run(message, { ytblink, repeat }) {
|
|
|
|
const { voiceChannel } = message.member;
|
|
|
|
const { voiceChannel } = message.member;
|
|
|
|
|
|
|
|
|
|
|
|
// If not in voice channel ask user to join
|
|
|
|
// If not in voice channel ask user to join
|
|
|
@ -35,10 +35,8 @@ module.exports = class MusicCommand extends Command {
|
|
|
|
voiceChannel.join().then(connection => {
|
|
|
|
voiceChannel.join().then(connection => {
|
|
|
|
const stream = ytdl(ytblink, { filter: 'audioonly' });
|
|
|
|
const stream = ytdl(ytblink, { filter: 'audioonly' });
|
|
|
|
const dispatcher = connection.playStream(stream);
|
|
|
|
const dispatcher = connection.playStream(stream);
|
|
|
|
|
|
|
|
|
|
|
|
// End at then end of the audio stream
|
|
|
|
// End at then end of the audio stream
|
|
|
|
dispatcher.on('end', () => voiceChannel.leave());
|
|
|
|
dispatcher.on('end', () => voiceChannel.leave());
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|