talk-back-bot
Version:
A Programable Virtual Assistsant
16 lines (14 loc) • 390 B
JavaScript
let data = require('./data')
const correct = require('./autoCorrect/correct')
function exeCommand(input) {
input = correct.correct(input)
for (let x in data.commands) {
for (let i in data.commands[x].q) {
if (input === data.commands[x].q[i]) {
return data.commands[x].a
}
}
}
return 'I am sorry, but I didn\'t quite get that.'
}
console.log(exeCommand('whats the time'))