This commit is contained in:
Daniel Odendahl Jr
2017-09-05 03:32:13 +00:00
parent 1c9b5156e9
commit e57b0b3afa
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -23,7 +23,7 @@ module.exports = class SoundboardCommand extends Command {
key: 'sound',
prompt: `What sound would you like to play? Either ${list(sounds, 'or')}.`,
type: 'string',
default: sounds[Math.floor(Math.random() * sounds.length)],
default: '',
validate: sound => {
if (sounds.includes(sound.toLowerCase())) return true;
return `Invalid sound, please enter either ${list(sounds, 'or')}.`;
@@ -35,7 +35,7 @@ module.exports = class SoundboardCommand extends Command {
}
async run(msg, args) {
const { sound } = args;
const sound = args.sound || sounds[Math.floor(Math.random() * sounds.length)];
const channel = msg.member.voiceChannel;
if (!channel) return msg.say('Please enter a voice channel first.');
if (!channel.permissionsFor(this.client.user).has(['CONNECT', 'SPEAK'])) {