Currently, I keep receiving Promise, and the error User localuser was in an empty topic named 'random'
.
My code is structured like this
const bot = new RiveScript();
bot.loadDirectory("./brain");
bot.sortReplies();
Below is in a function
// blah
if (text === 'blah') {
return {
attachment: blah()
};
}
// No command is correct
return {
text: getReply(text)
};
function getReply(msg) {
const reply = bot.reply("localuser", msg);
return reply;
}
I've been trying everything, but I still need help getting a result where the text goes into the function and returns a reply from the RiveScript. I also ran debug, so the RiveScript files are definitely being read. I also tried using async functions and await for getReply but it doesn't work either.