Removing the bots name from strings is done several different ways in multiple places in the repo.
nlc.confidence.high
// Obtain statement from res removing the bot name
var text = res.message.text.replace(robot.name, '').trim();
nlc.receive.js
// Remove the bot name from the bot statement
if (text.indexOf(botName) >= 0){
let botnameIndex = text.indexOf(botName);
text = text.substring(botnameIndex + botName.length);
}
nlc.catchall.js
function stripBotName(text) {
var nameToken = new RegExp('(^|\\s)@?' + botName + ':?\\s', 'g');
return text.replace(nameToken, ' ').trim();
}
Removing the bots name from strings is done several different ways in multiple places in the repo.
nlc.confidence.high
nlc.receive.js
nlc.catchall.js