Can HowdyAI's Botkit listen for attachment contents?

351 Views Asked by At

Attempting to use BotKit to have a custom integration react to a 3rd party integration. The 3rd party integration only communicates via replies as attachments.

Is there a way to have the my custom integration 'hear' attachments? I haven't been able to locate this in the documentation if it does exist already.

1

There are 1 best solutions below

0
On BEST ANSWER

The answer was present in the comments on the issue.

Essentially:

controller.on('bot_message', function(bot, message) {
    console.log('message.attachments: ' + message.attachments);
    var attachment = message.attachments[0];
    console.log('attachments.title: ' + attachment.title);
    console.log('attachments.text: ' + attachment.text);
});