forked from Supositware/Haha-Yes
This commit is contained in:
parent
cf1085b10b
commit
9309c76b9d
1 changed files with 3 additions and 3 deletions
|
@ -20,13 +20,13 @@ module.exports = class MusicCommand extends Command {
|
||||||
run(message, { ytblink }) {
|
run(message, { ytblink }) {
|
||||||
const { voiceChannel } = message.member;
|
const { voiceChannel } = message.member;
|
||||||
|
|
||||||
|
if (ytblink == 'stop') {
|
||||||
|
voiceChannel.leave()
|
||||||
|
} else
|
||||||
if (!voiceChannel) {
|
if (!voiceChannel) {
|
||||||
return message.reply('please join a voice channel first!');
|
return message.reply('please join a voice channel first!');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ytblink == 'stop') {
|
|
||||||
voiceChannel.leave()
|
|
||||||
} else
|
|
||||||
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);
|
||||||
|
|
Loading…
Reference in a new issue