Closed Montoya closed 8 years ago
Code:
const botBuilder = require('claudia-bot-builder');
const Promise = require('bluebird');
const lookup = Promise.promisify(require('whois').lookup);
const rp = require('request-promise');
// bunch of functions that aren't relevant to this
function dotcom(request) {
switch(request.type) {
case 'slack-message-action':
return dotcom_slack_message_action(request);
break;
case 'slack-slash-command':
return dotcom_slack_slash_command(request);
break;
case 'facebook':
return 'You said: '+request.text;
break;
default:
return 'Dunno who you are. I refuse to talk...'
break;
}
}
// user input is request.text
module.exports = botBuilder( request => dotcom(request) );
Ok, so, you enabled message delivery reports. We are sending them too through the Bot builder and they have the same type as the normal message (type: "facebook"
).
There's 2 things you can do:
request.text
exists (unless you are handling postbacks and attachments)We removed this in v1.3.2: https://github.com/claudiajs/claudia-bot-builder/releases/tag/v1.3.2
Thank you!
Hi, built a simple Facebook integration that just echoes the text and it's replying over and over and over (and after the first reply it has lost the text from the request).