From fbf5b5d68ed0b419c6145d334a5ee502ffe96419 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Mon, 22 May 2017 00:42:43 +0000 Subject: [PATCH] Fix All Perms in Soundboard --- commands/random/soundboard.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/commands/random/soundboard.js b/commands/random/soundboard.js index b550b41f..1a10d142 100644 --- a/commands/random/soundboard.js +++ b/commands/random/soundboard.js @@ -28,14 +28,15 @@ module.exports = class SoundboardCommand extends Command { } async run(msg, args) { - if (!msg.channel.permissionsFor(this.client.user).has('CONNECT')) - return msg.say('This Command requires the `Connect` Permission.'); - if (!msg.channel.permissionsFor(this.client.user).has('SPEAK')) - return msg.say('This Command requires the `Speak` Permission.'); if (!msg.channel.permissionsFor(this.client.user).has('ADD_REACTIONS')) return msg.say('This Command requires the `Add Reactions` Permission.'); const voiceChannel = msg.member.voiceChannel; if (!voiceChannel) return msg.say('Please enter a Voice Channel first.'); + if (!voiceChannel.permissionsFor(this.client.user).has('CONNECT')) + return msg.say('This Command requires the `Connect` Permission.'); + if (!voiceChannel.permissionsFor(this.client.user).has('SPEAK')) + return msg.say('This Command requires the `Speak` Permission.'); + if (!voiceChannel.joinable) return msg.say('This Voice Channel is not joinable.'); const alreadyConnected = this.client.voiceConnections.get(voiceChannel.guild.id); if (alreadyConnected) return msg.say('I am already playing a sound.'); const { sound } = args;