Skip to content

Commit

Permalink
Fixed requiring user to be in a channel when removing sound
Browse files Browse the repository at this point in the history
  • Loading branch information
markokajzer committed Dec 28, 2016
1 parent a7711ea commit 9b16c06
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/MessageHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class MessageHandler {
message.channel.sendMessage(Util.mostPlayedList());
} else if (message.content === '!add' && message.attachments.size > 0) {
Util.addSounds(message.attachments, message.channel);
} else if (message.content.startsWith('!remove ')) {
const sound = message.content.replace('!remove ', '');
Util.removeSound(sound, message.channel);
} else {
const sounds = Util.getSounds();
if (message.content === '!sounds') {
Expand All @@ -23,9 +26,6 @@ class MessageHandler {
} else if (message.content === '!stop') {
voiceChannel.leave();
this.bot.queue = [];
} else if (message.content.startsWith('!remove ')) {
const sound = message.content.replace('!remove ', '');
Util.removeSound(sound, message.channel);
} else if (message.content === '!random') {
const random = sounds[Math.floor(Math.random() * sounds.length)];
this.bot.addToQueue(voiceChannel, random);
Expand Down

0 comments on commit 9b16c06

Please sign in to comment.