This commit is contained in:
Dragon Fire
2020-10-24 14:25:32 -04:00
parent 40080cadef
commit ebd26a7b0e
25 changed files with 42 additions and 44 deletions
+2 -2
View File
@@ -52,11 +52,11 @@ module.exports = class SoundboardCommand extends Command {
prompt: `What sound do you want to play? Either ${list(sounds, 'or')}.`,
type: 'string',
validate: sound => {
const choice = sound.toLowerCase().replace(/ /g, '-');
const choice = sound.toLowerCase().replaceAll(' ', '-');
if (sounds.includes(choice)) return true;
return `You provided an invalid sound. Please choose either ${list(sounds, 'or')}.`;
},
parse: sound => `${sound.toLowerCase().replace(/ /g, '-')}.mp3`
parse: sound => `${sound.toLowerCase().replaceAll(' ', '-')}.mp3`
}
]
});