module.exports = function(controller) {
controller.hears('b!play', 'ambient', async (bot, message) => {
try {
const connection = await bot.api.joinVoiceChannel();
const dispatcher = connection.playFile('/Users/brh55/Music/funny.mp3');
dispatcher.setVolume(0.5)
dispatcher.on('end', () => {
bot.createConversation(message, (err, convo) => {
convo.addQuestion('How would rate that from a scale of 0 to 5?', (response, convo) => {
const numberRating = response.text.match(/[0-5]/g);
if (numberRating.length < 1) {
convo.say('Uhh... not a valid rating, try again later!');
convo.next();
}
convo.say('Oh wow! Thanks for letting me know!');
db.save(message.member.id, numberRating[0]);
convo.next();
});
});
bot.api.leaveVoiceChannel();
});
}
I get an error message on line 3 try “Parsing Error: Missing catch or finally clause”, using the preset discord bot kit starter project. Please help